diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/base64.mjs b/base64.mjs new file mode 100644 index 00000000..a175b5e5 --- /dev/null +++ b/base64.mjs @@ -0,0 +1,113 @@ +/** + * Convert between Uint8Array and Base64 strings + * Allows for any encoded JS string to be converted (as opposed to atob()/btoa() which only supports latin1) + * + * Original implementation by madmurphy on MDN + * @see https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_1_–_JavaScript%27s_UTF-16_%3E_base64 + */ + +function b64ToUint6(nChr) { + return nChr > 64 && nChr < 91 + ? nChr - 65 + : nChr > 96 && nChr < 123 + ? nChr - 71 + : nChr > 47 && nChr < 58 + ? nChr + 4 + : nChr === 43 + ? 62 + : nChr === 47 + ? 63 + : 0 +} + +export function decodeToArray(base64string, blockSize) { + var sB64Enc = base64string.replace(/[^A-Za-z0-9\+\/]/g, ''), + nInLen = sB64Enc.length, + nOutLen = blockSize + ? Math.ceil(((nInLen * 3 + 1) >>> 2) / blockSize) * blockSize + : (nInLen * 3 + 1) >>> 2, + aBytes = new Uint8Array(nOutLen) + + for ( + var nMod3, nMod4, nUint24 = 0, nOutIdx = 0, nInIdx = 0; + nInIdx < nInLen; + nInIdx++ + ) { + nMod4 = nInIdx & 3 + nUint24 |= b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << (18 - 6 * nMod4) + if (nMod4 === 3 || nInLen - nInIdx === 1) { + for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) { + aBytes[nOutIdx] = (nUint24 >>> ((16 >>> nMod3) & 24)) & 255 + } + nUint24 = 0 + } + } + + return aBytes +} + +function uint6ToB64(nUint6) { + return nUint6 < 26 + ? nUint6 + 65 + : nUint6 < 52 + ? nUint6 + 71 + : nUint6 < 62 + ? nUint6 - 4 + : nUint6 === 62 + ? 43 + : nUint6 === 63 + ? 47 + : 65 +} + +export function encodeFromArray(bytes) { + var eqLen = (3 - (bytes.length % 3)) % 3, + sB64Enc = '' + + for ( + var nMod3, nLen = bytes.length, nUint24 = 0, nIdx = 0; + nIdx < nLen; + nIdx++ + ) { + nMod3 = nIdx % 3 + /* Uncomment the following line in order to split the output in lines 76-character long: */ + /* + if (nIdx > 0 && (nIdx * 4 / 3) % 76 === 0) { sB64Enc += "\r\n"; } + */ + nUint24 |= bytes[nIdx] << ((16 >>> nMod3) & 24) + if (nMod3 === 2 || bytes.length - nIdx === 1) { + sB64Enc += String.fromCharCode( + uint6ToB64((nUint24 >>> 18) & 63), + uint6ToB64((nUint24 >>> 12) & 63), + uint6ToB64((nUint24 >>> 6) & 63), + uint6ToB64(nUint24 & 63) + ) + nUint24 = 0 + } + } + + return eqLen === 0 + ? sB64Enc + : sB64Enc.substring(0, sB64Enc.length - eqLen) + (eqLen === 1 ? '=' : '==') +} + +/** + * URL-safe variants of Base64 conversion functions (aka base64url) + * @see https://tools.ietf.org/html/rfc4648#section-5 + */ + +export function encodeFromArrayUrlSafe(bytes) { + return encodeURIComponent( + encodeFromArray(bytes) + .replace(/\+/g, '-') + .replace(/\//g, '_') + ) +} + +export function decodeToArrayUrlSafe(base64string) { + return decodeToArray( + decodeURIComponent(base64string) + .replace(/-/g, '+') + .replace(/_/g, '/') + ) +} diff --git a/docs/.lock b/docs/.lock new file mode 100644 index 00000000..e69de29b diff --git a/docs/.nojekyll b/docs/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/docs/crates.js b/docs/crates.js new file mode 100644 index 00000000..7b7e68c8 --- /dev/null +++ b/docs/crates.js @@ -0,0 +1 @@ +window.ALL_CRATES = ["egglog"]; \ No newline at end of file diff --git a/docs/egglog/all.html b/docs/egglog/all.html new file mode 100644 index 00000000..8418a25c --- /dev/null +++ b/docs/egglog/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

Macros

Functions

Type Aliases

\ No newline at end of file diff --git a/docs/egglog/ast/desugar/index.html b/docs/egglog/ast/desugar/index.html new file mode 100644 index 00000000..9eb2e661 --- /dev/null +++ b/docs/egglog/ast/desugar/index.html @@ -0,0 +1 @@ +egglog::ast::desugar - Rust

Module egglog::ast::desugar

source ·
\ No newline at end of file diff --git a/docs/egglog/ast/desugar/sidebar-items.js b/docs/egglog/ast/desugar/sidebar-items.js new file mode 100644 index 00000000..5244ce01 --- /dev/null +++ b/docs/egglog/ast/desugar/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {}; \ No newline at end of file diff --git a/docs/egglog/ast/enum.Change.html b/docs/egglog/ast/enum.Change.html new file mode 100644 index 00000000..b64f508f --- /dev/null +++ b/docs/egglog/ast/enum.Change.html @@ -0,0 +1,27 @@ +Change in egglog::ast - Rust

Enum egglog::ast::Change

source ·
pub enum Change {
+    Delete,
+    Subsume,
+}
Expand description

Change a function entry.

+

Variants§

§

Delete

delete this entry from a function. +Be wary! Only delete entries that are guaranteed to be not useful.

+
§

Subsume

subsume this entry so that it cannot be queried or extracted, but still can be checked. +Note that this is currently forbidden for functions with custom merges.

+

Trait Implementations§

source§

impl Clone for Change

source§

fn clone(&self) -> Change

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Change

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for Change

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Change

source§

fn eq(&self, other: &Change) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for Change

source§

impl Eq for Change

source§

impl StructuralPartialEq for Change

Auto Trait Implementations§

§

impl Freeze for Change

§

impl RefUnwindSafe for Change

§

impl Send for Change

§

impl Sync for Change

§

impl Unpin for Change

§

impl UnwindSafe for Change

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/enum.GenericAction.html b/docs/egglog/ast/enum.GenericAction.html new file mode 100644 index 00000000..816ab64a --- /dev/null +++ b/docs/egglog/ast/enum.GenericAction.html @@ -0,0 +1,95 @@ +GenericAction in egglog::ast - Rust

Enum egglog::ast::GenericAction

source ·
pub enum GenericAction<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + PartialEq + Eq + Display + Hash,
{ + Let(Span, Leaf, GenericExpr<Head, Leaf>), + Set(Span, Head, Vec<GenericExpr<Head, Leaf>>, GenericExpr<Head, Leaf>), + Change(Span, Change, Head, Vec<GenericExpr<Head, Leaf>>), + Union(Span, GenericExpr<Head, Leaf>, GenericExpr<Head, Leaf>), + Extract(Span, GenericExpr<Head, Leaf>, GenericExpr<Head, Leaf>), + Panic(Span, String), + Expr(Span, GenericExpr<Head, Leaf>), +}

Variants§

§

Let(Span, Leaf, GenericExpr<Head, Leaf>)

Bind a variable to a particular datatype or primitive. +At the top level (in a Command::Action), this defines a global variable. +In a Command::Rule, this defines a local variable in the actions.

+
§

Set(Span, Head, Vec<GenericExpr<Head, Leaf>>, GenericExpr<Head, Leaf>)

set a function to a particular result. +set should not be used on datatypes- +instead, use union.

+
§

Change(Span, Change, Head, Vec<GenericExpr<Head, Leaf>>)

Delete or subsume (mark as hidden from future rewrites and unextractable) an entry from a function.

+
§

Union(Span, GenericExpr<Head, Leaf>, GenericExpr<Head, Leaf>)

union two datatypes, making them equal +in the implicit, global equality relation +of egglog. +All rules match modulo this equality relation.

+

Example:

+
(datatype Math (Num i64))
+(union (Num 1) (Num 2)); Define that Num 1 and Num 2 are equivalent
+(extract (Num 1)); Extracts Num 1
+(extract (Num 2)); Extracts Num 1
+
§

Extract(Span, GenericExpr<Head, Leaf>, GenericExpr<Head, Leaf>)

extract a datatype from the egraph, choosing +the smallest representative. +By default, each constructor costs 1 to extract +(common subexpressions are not shared in the cost +model). +The second argument is the number of variants to +extract, picking different terms in the +same equivalence class.

+
§

Panic(Span, String)

§

Expr(Span, GenericExpr<Head, Leaf>)

Implementations§

source§

impl<Head, Leaf> GenericAction<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + Eq + Display + Hash,

source

pub fn map_exprs( + &self, + f: &mut impl FnMut(&GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf> +) -> Self

source

pub fn visit_exprs( + self, + f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf> +) -> Self

Applys f to all sub-expressions (including self) +bottom-up, collecting the results.

+
source

pub fn subst( + &self, + subst: &mut impl FnMut(&Span, &Leaf) -> GenericExpr<Head, Leaf> +) -> Self

source

pub fn map_def_use(self, fvar: &mut impl FnMut(Leaf, bool) -> Leaf) -> Self

Trait Implementations§

source§

impl<Head, Leaf> Clone for GenericAction<Head, Leaf>
where + Head: Clone + Display + Clone, + Leaf: Clone + PartialEq + Eq + Display + Hash + Clone,

source§

fn clone(&self) -> GenericAction<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Head, Leaf> Debug for GenericAction<Head, Leaf>
where + Head: Clone + Display + Debug, + Leaf: Clone + PartialEq + Eq + Display + Hash + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head, Leaf> Display for GenericAction<Head, Leaf>
where + Head: Clone + Display + ToSexp, + Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head, Leaf> Hash for GenericAction<Head, Leaf>
where + Head: Clone + Display + Hash, + Leaf: Clone + PartialEq + Eq + Display + Hash + Hash,

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<Head, Leaf> PartialEq for GenericAction<Head, Leaf>
where + Head: Clone + Display + PartialEq, + Leaf: Clone + PartialEq + Eq + Display + Hash + PartialEq,

source§

fn eq(&self, other: &GenericAction<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl<Head, Leaf> ToSexp for GenericAction<Head, Leaf>
where + Head: Clone + Display + ToSexp, + Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source§

fn to_sexp(&self) -> Sexp

source§

impl<Head, Leaf> Eq for GenericAction<Head, Leaf>
where + Head: Clone + Display + Eq, + Leaf: Clone + PartialEq + Eq + Display + Hash + Eq,

source§

impl<Head, Leaf> StructuralPartialEq for GenericAction<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + PartialEq + Eq + Display + Hash,

Auto Trait Implementations§

§

impl<Head, Leaf> Freeze for GenericAction<Head, Leaf>
where + Leaf: Freeze, + Head: Freeze,

§

impl<Head, Leaf> RefUnwindSafe for GenericAction<Head, Leaf>
where + Leaf: RefUnwindSafe, + Head: RefUnwindSafe,

§

impl<Head, Leaf> Send for GenericAction<Head, Leaf>
where + Leaf: Send, + Head: Send,

§

impl<Head, Leaf> Sync for GenericAction<Head, Leaf>
where + Leaf: Sync, + Head: Sync,

§

impl<Head, Leaf> Unpin for GenericAction<Head, Leaf>
where + Leaf: Unpin, + Head: Unpin,

§

impl<Head, Leaf> UnwindSafe for GenericAction<Head, Leaf>
where + Leaf: UnwindSafe, + Head: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/enum.GenericCommand.html b/docs/egglog/ast/enum.GenericCommand.html new file mode 100644 index 00000000..379687e9 --- /dev/null +++ b/docs/egglog/ast/enum.GenericCommand.html @@ -0,0 +1,319 @@ +GenericCommand in egglog::ast - Rust

Enum egglog::ast::GenericCommand

source ·
pub enum GenericCommand<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + PartialEq + Eq + Display + Hash,
{ +
Show 25 variants SetOption { + name: Symbol, + value: GenericExpr<Head, Leaf>, + }, + Datatype { + span: Span, + name: Symbol, + variants: Vec<Variant>, + }, + Datatypes { + span: Span, + datatypes: Vec<(Span, Symbol, Subdatatypes)>, + }, + Sort(Span, Symbol, Option<(Symbol, Vec<Expr>)>), + Function(GenericFunctionDecl<Head, Leaf>), + Relation { + span: Span, + constructor: Symbol, + inputs: Vec<Symbol>, + }, + AddRuleset(Symbol), + UnstableCombinedRuleset(Symbol, Vec<Symbol>), + Rule { + name: Symbol, + ruleset: Symbol, + rule: GenericRule<Head, Leaf>, + }, + Rewrite(Symbol, GenericRewrite<Head, Leaf>, Subsume), + BiRewrite(Symbol, GenericRewrite<Head, Leaf>), + Action(GenericAction<Head, Leaf>), + RunSchedule(GenericSchedule<Head, Leaf>), + PrintOverallStatistics, + Simplify { + span: Span, + expr: GenericExpr<Head, Leaf>, + schedule: GenericSchedule<Head, Leaf>, + }, + QueryExtract { + span: Span, + variants: usize, + expr: GenericExpr<Head, Leaf>, + }, + Check(Span, Vec<GenericFact<Head, Leaf>>), + PrintFunction(Span, Symbol, usize), + PrintSize(Span, Option<Symbol>), + Input { + span: Span, + name: Symbol, + file: String, + }, + Output { + span: Span, + file: String, + exprs: Vec<GenericExpr<Head, Leaf>>, + }, + Push(usize), + Pop(Span, usize), + Fail(Span, Box<GenericCommand<Head, Leaf>>), + Include(Span, String), +
}
Expand description

A Command is the top-level construct in egglog. +It includes defining rules, declaring functions, +adding to tables, and running rules (via a Schedule).

+

Variants§

§

SetOption

Egglog supports several experimental options +that can be set using the set-option command.

+

Options supported include:

+
    +
  • “interactive_mode” (default: false): when enabled, egglog prints “(done)” after each command, allowing an external +tool to know when each command has finished running.
  • +
+

Fields

§name: Symbol
§value: GenericExpr<Head, Leaf>
§

Datatype

Declare a user-defined datatype. +Datatypes can be unioned with Action::Union either +at the top level or in the actions of a rule. +This makes them equal in the implicit, global equality relation. +Example:

+
(datatype Math
+  (Num i64)
+  (Var String)
+  (Add Math Math)
+  (Mul Math Math))
+
+

defines a simple Math datatype with variants for numbers, named variables, addition and multiplication.

+

Datatypes desugar directly to a Command::Sort and a Command::Function for each constructor. +The code above becomes:

+
(sort Math)
+(function Num (i64) Math)
+(function Var (String) Math)
+(function Add (Math Math) Math)
+(function Mul (Math Math) Math)
+Datatypes are also known as algebraic data types, tagged unions and sum types.

Fields

§span: Span
§name: Symbol
§variants: Vec<Variant>
§

Datatypes

Fields

§span: Span
§datatypes: Vec<(Span, Symbol, Subdatatypes)>
§

Sort(Span, Symbol, Option<(Symbol, Vec<Expr>)>)

Create a new user-defined sort, which can then +be used in new Command::Function declarations. +The Command::Datatype command desugars directly to this command, with one Command::Function +per constructor. +The main use of this command (as opposed to using Command::Datatype) is for forward-declaring a sort for mutually-recursive datatypes.

+

It can also be used to create +a container sort. +For example, here’s how to make a sort for vectors +of some user-defined sort Math:

+
(sort MathVec (Vec Math))
+
+

Now MathVec can be used as an input or output sort.

+
§

Function(GenericFunctionDecl<Head, Leaf>)

Declare an egglog function, which is a database table with a +a functional dependency (also called a primary key) on its inputs to one output.

+
(function <name:Ident> <schema:Schema> <cost:Cost>
+       (:on_merge <List<Action>>)?
+       (:merge <Expr>)?
+       (:default <Expr>)?)
+
+

A function can have a cost for extraction. +It can also have a default value, which is used when calling the function.

+

Finally, it can have a merge and on_merge, which are triggered when +the function dependency is violated. +In this case, the merge expression determines which of the two outputs +for the same input is used. +The on_merge actions are run after the merge expression is evaluated.

+

Note that the :merge expression must be monotonic +for the behavior of the egglog program to be consistent and defined. +In other words, the merge function must define a lattice on the output of the function. +If values are merged in different orders, they should still result in the same output. +If the merge expression is not monotonic, the behavior can vary as +actions may be applied more than once with different results.

+

The function is a datatype when:

+
    +
  • The output is not a primitive
  • +
  • No merge function is provided
  • +
  • No default is provided
  • +
+

For example, the following is a datatype:

+
(function Add (i64 i64) Math)
+
+

However, this function is not:

+
(function LowerBound (Math) i64 :merge (max old new))
+
+

A datatype can be unioned with Action::Union +with another datatype of the same sort.

+

Functions that are not a datatype can be set +with Action::Set.

+
§

Relation

The relation is syntactic sugar for a named function which returns the Unit type. +Example:

+
(relation path (i64 i64))
+(relation edge (i64 i64))
+
+

Desugars to:

+
(function path (i64 i64) Unit :default ())
+(function edge (i64 i64) Unit :default ())
+

Fields

§span: Span
§constructor: Symbol
§inputs: Vec<Symbol>
§

AddRuleset(Symbol)

Using the ruleset command, defines a new +ruleset that can be added to in Command::Rules. +Rulesets are used to group rules together +so that they can be run together in a Schedule.

+

Example: +Ruleset allows users to define a ruleset- a set of rules

+
(ruleset myrules)
+(rule ((edge x y))
+      ((path x y))
+      :ruleset myrules)
+(run myrules 2)
+
§

UnstableCombinedRuleset(Symbol, Vec<Symbol>)

Using the combined-ruleset command, construct another ruleset +which runs all the rules in the given rulesets. +This is useful for running multiple rulesets together. +The combined ruleset also inherits any rules added to the individual rulesets +after the combined ruleset is declared.

+

Example:

+
(ruleset myrules1)
+(rule ((edge x y))
+      ((path x y))
+     :ruleset myrules1)
+(ruleset myrules2)
+(rule ((path x y) (edge y z))
+      ((path x z))
+      :ruleset myrules2)
+(combined-ruleset myrules-combined myrules1 myrules2)
§

Rule

(rule <body:List<Fact>> <head:List<Action>>)
+
+

defines an egglog rule. +The rule matches a list of facts with respect to +the global database, and runs the list of actions +for each match. +The matches are done modulo equality, meaning +equal datatypes in the database are considered +equal. +Example:

+
(rule ((edge x y))
+      ((path x y)))
+(rule ((path x y) (edge y z))
+      ((path x z)))
+

Fields

§name: Symbol
§ruleset: Symbol
§rule: GenericRule<Head, Leaf>
§

Rewrite(Symbol, GenericRewrite<Head, Leaf>, Subsume)

rewrite is syntactic sugar for a specific form of rule +which simply unions the left and right hand sides.

+

Example:

+
(rewrite (Add a b)
+         (Add b a))
+
+

Desugars to:

+
(rule ((= lhs (Add a b)))
+      ((union lhs (Add b a))))
+
+

Additionally, additional facts can be specified +using a :when clause. +For example, the same rule can be run only +when a is zero:

+
(rewrite (Add a b)
+         (Add b a)
+         :when ((= a (Num 0)))
+
+

Add the :subsume flag to cause the left hand side to be subsumed after matching, which means it can +no longer be matched in a rule, but can still be checked against (See Change for more details.)

+
(rewrite (Mul a 2) (bitshift-left a 1) :subsume)
+
+

Desugars to:

+
(rule ((= lhs (Mul a 2)))
+      ((union lhs (bitshift-left a 1))
+       (subsume (Mul a 2))))
+
§

BiRewrite(Symbol, GenericRewrite<Head, Leaf>)

Similar to Command::Rewrite, but +generates two rules, one for each direction.

+

Example:

+
(bi-rewrite (Mul (Var x) (Num 0))
+            (Var x))
+
+

Becomes:

+
(rule ((= lhs (Mul (Var x) (Num 0))))
+      ((union lhs (Var x))))
+(rule ((= lhs (Var x)))
+      ((union lhs (Mul (Var x) (Num 0)))))
+
§

Action(GenericAction<Head, Leaf>)

Perform an Action on the global database +(see documentation for Action for more details). +Example:

+
(let xplusone (Add (Var "x") (Num 1)))
+
§

RunSchedule(GenericSchedule<Head, Leaf>)

Runs a Schedule, which specifies +rulesets and the number of times to run them.

+

Example:

+
(run-schedule
+    (saturate my-ruleset-1)
+    (run my-ruleset-2 4))
+
+

Runs my-ruleset-1 until saturation, +then runs my-ruleset-2 four times.

+

See Schedule for more details.

+
§

PrintOverallStatistics

Print runtime statistics about rules +and rulesets so far.

+
§

Simplify

Fields

§span: Span
§expr: GenericExpr<Head, Leaf>
§schedule: GenericSchedule<Head, Leaf>
§

QueryExtract

The query-extract command runs a query, +extracting the result for each match that it finds. +For a simpler extraction command, use Action::Extract instead.

+

Example:

+
(query-extract (Add a b))
+
+

Extracts every Add term in the database, once +for each class of equivalent a and b.

+

The resulting datatype is chosen from the egraph +as the smallest term by size (taking into account +the :cost annotations for each constructor). +This cost does not take into account common sub-expressions. +For example, the following term has cost 5:

+
(Add
+    (Num 1)
+    (Num 1))
+
+

Under the hood, this command is implemented with the EGraph::extract +function.

+

Fields

§span: Span
§variants: usize
§expr: GenericExpr<Head, Leaf>
§

Check(Span, Vec<GenericFact<Head, Leaf>>)

The check command checks that the given facts +match at least once in the current database. +The list of facts is matched in the same way a Command::Rule is matched.

+

Example:

+
(check (= (+ 1 2) 3))
+(check (<= 0 3) (>= 3 0))
+(fail (check (= 1 2)))
+
+

prints

+
[INFO ] Checked.
+[INFO ] Checked.
+[ERROR] Check failed
+[INFO ] Command failed as expected.
+
§

PrintFunction(Span, Symbol, usize)

Print out rows a given function, extracting each of the elements of the function. +Example:

+
(print-function Add 20)
+
+

prints the first 20 rows of the Add function.

+
§

PrintSize(Span, Option<Symbol>)

Print out the number of rows in a function or all functions.

+
§

Input

Input a CSV file directly into a function.

+

Fields

§span: Span
§name: Symbol
§file: String
§

Output

Extract and output a set of expressions to a file.

+

Fields

§span: Span
§file: String
§exprs: Vec<GenericExpr<Head, Leaf>>
§

Push(usize)

push the current egraph n times so that it is saved. +Later, the current database and rules can be restored using pop.

+
§

Pop(Span, usize)

pop the current egraph, restoring the previous one. +The argument specifies how many egraphs to pop.

+
§

Fail(Span, Box<GenericCommand<Head, Leaf>>)

Assert that a command fails with an error.

+
§

Include(Span, String)

Include another egglog file directly as text and run it.

+

Trait Implementations§

source§

impl<Head, Leaf> Clone for GenericCommand<Head, Leaf>
where + Head: Clone + Display + Clone, + Leaf: Clone + PartialEq + Eq + Display + Hash + Clone,

source§

fn clone(&self) -> GenericCommand<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Head, Leaf> Debug for GenericCommand<Head, Leaf>
where + Head: Clone + Display + Debug, + Leaf: Clone + PartialEq + Eq + Display + Hash + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head, Leaf> Display for GenericCommand<Head, Leaf>
where + Head: Clone + Display + ToSexp, + Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head, Leaf> ToSexp for GenericCommand<Head, Leaf>
where + Head: Clone + Display + ToSexp, + Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source§

fn to_sexp(&self) -> Sexp

Auto Trait Implementations§

§

impl<Head, Leaf> Freeze for GenericCommand<Head, Leaf>
where + Leaf: Freeze, + Head: Freeze,

§

impl<Head, Leaf> RefUnwindSafe for GenericCommand<Head, Leaf>
where + Leaf: RefUnwindSafe, + Head: RefUnwindSafe,

§

impl<Head, Leaf> Send for GenericCommand<Head, Leaf>
where + Leaf: Send, + Head: Send,

§

impl<Head, Leaf> Sync for GenericCommand<Head, Leaf>
where + Leaf: Sync, + Head: Sync,

§

impl<Head, Leaf> Unpin for GenericCommand<Head, Leaf>
where + Leaf: Unpin, + Head: Unpin,

§

impl<Head, Leaf> UnwindSafe for GenericCommand<Head, Leaf>
where + Leaf: UnwindSafe, + Head: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/enum.GenericExpr.html b/docs/egglog/ast/enum.GenericExpr.html new file mode 100644 index 00000000..535fdd9e --- /dev/null +++ b/docs/egglog/ast/enum.GenericExpr.html @@ -0,0 +1,54 @@ +GenericExpr in egglog::ast - Rust

Enum egglog::ast::GenericExpr

source ·
pub enum GenericExpr<Head, Leaf> {
+    Lit(Span, Literal),
+    Var(Span, Leaf),
+    Call(Span, Head, Vec<Self>),
+}

Variants§

§

Lit(Span, Literal)

§

Var(Span, Leaf)

§

Call(Span, Head, Vec<Self>)

Implementations§

source§

impl GenericExpr<ResolvedCall, ResolvedVar>

source

pub fn output_type(&self) -> ArcSort

source§

impl GenericExpr<GlobalSymbol, GlobalSymbol>

source

pub fn call_no_span( + op: impl Into<Symbol>, + children: impl IntoIterator<Item = Self> +) -> Self

source

pub fn lit_no_span(lit: impl Into<Literal>) -> Self

source

pub fn var_no_span(v: impl Into<Symbol>) -> Self

source§

impl<Head: Clone + Display, Leaf: Hash + Clone + Display + Eq> GenericExpr<Head, Leaf>

source

pub fn span(&self) -> Span

source

pub fn is_var(&self) -> bool

source

pub fn get_var(&self) -> Option<Leaf>

source

pub fn ast_size(&self) -> usize

source

pub fn walk(&self, pre: &mut impl FnMut(&Self), post: &mut impl FnMut(&Self))

source

pub fn fold<Out>(&self, f: &mut impl FnMut(&Self, Vec<Out>) -> Out) -> Out

source

pub fn visit_exprs(self, f: &mut impl FnMut(Self) -> Self) -> Self

Applys f to all sub-expressions (including self) +bottom-up, collecting the results.

+
source

pub fn subst<Head2, Leaf2>( + &self, + subst_leaf: &mut impl FnMut(&Span, &Leaf) -> GenericExpr<Head2, Leaf2>, + subst_head: &mut impl FnMut(&Head) -> Head2 +) -> GenericExpr<Head2, Leaf2>

subst replaces occurrences of variables and head symbols in the expression.

+
source

pub fn subst_leaf<Leaf2>( + &self, + subst_leaf: &mut impl FnMut(&Span, &Leaf) -> GenericExpr<Head, Leaf2> +) -> GenericExpr<Head, Leaf2>

source

pub fn vars(&self) -> impl Iterator<Item = Leaf> + '_

source§

impl<Head: Display, Leaf: Display> GenericExpr<Head, Leaf>

source

pub fn to_sexp(&self) -> Sexp

Converts this expression into a +s-expression (symbolic expression). +Example: (Add (Add 2 3) 4)

+

Trait Implementations§

source§

impl<Head: Clone, Leaf: Clone> Clone for GenericExpr<Head, Leaf>

source§

fn clone(&self) -> GenericExpr<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Head: Debug, Leaf: Debug> Debug for GenericExpr<Head, Leaf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head, Leaf> Display for GenericExpr<Head, Leaf>
where + Head: Display, + Leaf: Display,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head: Hash, Leaf: Hash> Hash for GenericExpr<Head, Leaf>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<Head: PartialEq, Leaf: PartialEq> PartialEq for GenericExpr<Head, Leaf>

source§

fn eq(&self, other: &GenericExpr<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl<Head: Eq, Leaf: Eq> Eq for GenericExpr<Head, Leaf>

source§

impl<Head, Leaf> StructuralPartialEq for GenericExpr<Head, Leaf>

Auto Trait Implementations§

§

impl<Head, Leaf> Freeze for GenericExpr<Head, Leaf>
where + Leaf: Freeze, + Head: Freeze,

§

impl<Head, Leaf> RefUnwindSafe for GenericExpr<Head, Leaf>
where + Leaf: RefUnwindSafe, + Head: RefUnwindSafe,

§

impl<Head, Leaf> Send for GenericExpr<Head, Leaf>
where + Leaf: Send, + Head: Send,

§

impl<Head, Leaf> Sync for GenericExpr<Head, Leaf>
where + Leaf: Sync, + Head: Sync,

§

impl<Head, Leaf> Unpin for GenericExpr<Head, Leaf>
where + Leaf: Unpin, + Head: Unpin,

§

impl<Head, Leaf> UnwindSafe for GenericExpr<Head, Leaf>
where + Leaf: UnwindSafe, + Head: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/enum.GenericFact.html b/docs/egglog/ast/enum.GenericFact.html new file mode 100644 index 00000000..cd61b150 --- /dev/null +++ b/docs/egglog/ast/enum.GenericFact.html @@ -0,0 +1,47 @@ +GenericFact in egglog::ast - Rust

Enum egglog::ast::GenericFact

source ·
pub enum GenericFact<Head, Leaf> {
+    Eq(Span, Vec<GenericExpr<Head, Leaf>>),
+    Fact(GenericExpr<Head, Leaf>),
+}
Expand description

Facts are the left-hand side of a Command::Rule. +They represent a part of a database query. +Facts can be expressions or equality constraints between expressions.

+

Note that primitives such as != are partial. +When two things are equal, it returns nothing and the query does not match. +For example, the following egglog code runs:

+
(fail (check (!= 1 1)))
+

Variants§

§

Eq(Span, Vec<GenericExpr<Head, Leaf>>)

Must be at least two things in an eq fact

+
§

Fact(GenericExpr<Head, Leaf>)

Trait Implementations§

source§

impl<Head: Clone, Leaf: Clone> Clone for GenericFact<Head, Leaf>

source§

fn clone(&self) -> GenericFact<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Head: Debug, Leaf: Debug> Debug for GenericFact<Head, Leaf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head, Leaf> Display for GenericFact<Head, Leaf>
where + Head: Display, + Leaf: Display,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head: Hash, Leaf: Hash> Hash for GenericFact<Head, Leaf>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<Head: PartialEq, Leaf: PartialEq> PartialEq for GenericFact<Head, Leaf>

source§

fn eq(&self, other: &GenericFact<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl<Head, Leaf> ToSexp for GenericFact<Head, Leaf>
where + Head: Display, + Leaf: Display,

source§

fn to_sexp(&self) -> Sexp

source§

impl<Head: Eq, Leaf: Eq> Eq for GenericFact<Head, Leaf>

source§

impl<Head, Leaf> StructuralPartialEq for GenericFact<Head, Leaf>

Auto Trait Implementations§

§

impl<Head, Leaf> Freeze for GenericFact<Head, Leaf>
where + Leaf: Freeze, + Head: Freeze,

§

impl<Head, Leaf> RefUnwindSafe for GenericFact<Head, Leaf>
where + Leaf: RefUnwindSafe, + Head: RefUnwindSafe,

§

impl<Head, Leaf> Send for GenericFact<Head, Leaf>
where + Leaf: Send, + Head: Send,

§

impl<Head, Leaf> Sync for GenericFact<Head, Leaf>
where + Leaf: Sync, + Head: Sync,

§

impl<Head, Leaf> Unpin for GenericFact<Head, Leaf>
where + Leaf: Unpin, + Head: Unpin,

§

impl<Head, Leaf> UnwindSafe for GenericFact<Head, Leaf>
where + Leaf: UnwindSafe, + Head: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/enum.GenericNCommand.html b/docs/egglog/ast/enum.GenericNCommand.html new file mode 100644 index 00000000..7aff6e7e --- /dev/null +++ b/docs/egglog/ast/enum.GenericNCommand.html @@ -0,0 +1,95 @@ +GenericNCommand in egglog::ast - Rust

Enum egglog::ast::GenericNCommand

source ·
pub enum GenericNCommand<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + PartialEq + Eq + Display + Hash,
{ +
Show 17 variants SetOption { + name: Symbol, + value: GenericExpr<Head, Leaf>, + }, + Sort(Span, Symbol, Option<(Symbol, Vec<GenericExpr<Symbol, Symbol>>)>), + Function(GenericFunctionDecl<Head, Leaf>), + AddRuleset(Symbol), + UnstableCombinedRuleset(Symbol, Vec<Symbol>), + NormRule { + name: Symbol, + ruleset: Symbol, + rule: GenericRule<Head, Leaf>, + }, + CoreAction(GenericAction<Head, Leaf>), + RunSchedule(GenericSchedule<Head, Leaf>), + PrintOverallStatistics, + Check(Span, Vec<GenericFact<Head, Leaf>>), + PrintTable(Span, Symbol, usize), + PrintSize(Span, Option<Symbol>), + Output { + span: Span, + file: String, + exprs: Vec<GenericExpr<Head, Leaf>>, + }, + Push(usize), + Pop(Span, usize), + Fail(Span, Box<GenericNCommand<Head, Leaf>>), + Input { + span: Span, + name: Symbol, + file: String, + }, +
}
Expand description

A NCommand is a desugared Command, where syntactic sugars +like Command::Datatype and Command::Rewrite +are eliminated. +Most of the heavy lifting in egglog is done over NCommands.

+

GenericNCommand is a generalization of NCommand, like how GenericCommand +is a generalization of Command, allowing annotations over Head and Leaf.

+

TODO: The name “NCommand” used to denote normalized command, but this +meaning is obsolete. A future PR should rename this type to something +like “DCommand”.

+

Variants§

§

SetOption

Fields

§name: Symbol
§value: GenericExpr<Head, Leaf>
§

Sort(Span, Symbol, Option<(Symbol, Vec<GenericExpr<Symbol, Symbol>>)>)

§

Function(GenericFunctionDecl<Head, Leaf>)

§

AddRuleset(Symbol)

§

UnstableCombinedRuleset(Symbol, Vec<Symbol>)

§

NormRule

Fields

§name: Symbol
§ruleset: Symbol
§rule: GenericRule<Head, Leaf>
§

CoreAction(GenericAction<Head, Leaf>)

§

RunSchedule(GenericSchedule<Head, Leaf>)

§

PrintOverallStatistics

§

Check(Span, Vec<GenericFact<Head, Leaf>>)

§

PrintTable(Span, Symbol, usize)

§

PrintSize(Span, Option<Symbol>)

§

Output

Fields

§span: Span
§file: String
§exprs: Vec<GenericExpr<Head, Leaf>>
§

Push(usize)

§

Pop(Span, usize)

§

Fail(Span, Box<GenericNCommand<Head, Leaf>>)

§

Input

Fields

§span: Span
§name: Symbol
§file: String

Implementations§

source§

impl<Head, Leaf> GenericNCommand<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + PartialEq + Eq + Display + Hash,

source

pub fn to_command(&self) -> GenericCommand<Head, Leaf>

source

pub fn visit_exprs( + self, + f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf> +) -> Self

Trait Implementations§

source§

impl<Head, Leaf> Clone for GenericNCommand<Head, Leaf>
where + Head: Clone + Display + Clone, + Leaf: Clone + PartialEq + Eq + Display + Hash + Clone,

source§

fn clone(&self) -> GenericNCommand<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Head, Leaf> Debug for GenericNCommand<Head, Leaf>
where + Head: Clone + Display + Debug, + Leaf: Clone + PartialEq + Eq + Display + Hash + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head, Leaf> Display for GenericNCommand<Head, Leaf>
where + Head: Clone + Display + ToSexp, + Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head, Leaf> Hash for GenericNCommand<Head, Leaf>
where + Head: Clone + Display + Hash, + Leaf: Clone + PartialEq + Eq + Display + Hash + Hash,

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<Head, Leaf> PartialEq for GenericNCommand<Head, Leaf>
where + Head: Clone + Display + PartialEq, + Leaf: Clone + PartialEq + Eq + Display + Hash + PartialEq,

source§

fn eq(&self, other: &GenericNCommand<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl<Head, Leaf> Eq for GenericNCommand<Head, Leaf>
where + Head: Clone + Display + Eq, + Leaf: Clone + PartialEq + Eq + Display + Hash + Eq,

source§

impl<Head, Leaf> StructuralPartialEq for GenericNCommand<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + PartialEq + Eq + Display + Hash,

Auto Trait Implementations§

§

impl<Head, Leaf> Freeze for GenericNCommand<Head, Leaf>
where + Leaf: Freeze, + Head: Freeze,

§

impl<Head, Leaf> RefUnwindSafe for GenericNCommand<Head, Leaf>
where + Leaf: RefUnwindSafe, + Head: RefUnwindSafe,

§

impl<Head, Leaf> Send for GenericNCommand<Head, Leaf>
where + Leaf: Send, + Head: Send,

§

impl<Head, Leaf> Sync for GenericNCommand<Head, Leaf>
where + Leaf: Sync, + Head: Sync,

§

impl<Head, Leaf> Unpin for GenericNCommand<Head, Leaf>
where + Leaf: Unpin, + Head: Unpin,

§

impl<Head, Leaf> UnwindSafe for GenericNCommand<Head, Leaf>
where + Leaf: UnwindSafe, + Head: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/enum.GenericSchedule.html b/docs/egglog/ast/enum.GenericSchedule.html new file mode 100644 index 00000000..7bc2065d --- /dev/null +++ b/docs/egglog/ast/enum.GenericSchedule.html @@ -0,0 +1,35 @@ +GenericSchedule in egglog::ast - Rust

Enum egglog::ast::GenericSchedule

source ·
pub enum GenericSchedule<Head, Leaf> {
+    Saturate(Span, Box<GenericSchedule<Head, Leaf>>),
+    Repeat(Span, usize, Box<GenericSchedule<Head, Leaf>>),
+    Run(Span, GenericRunConfig<Head, Leaf>),
+    Sequence(Span, Vec<GenericSchedule<Head, Leaf>>),
+}

Variants§

§

Saturate(Span, Box<GenericSchedule<Head, Leaf>>)

§

Repeat(Span, usize, Box<GenericSchedule<Head, Leaf>>)

§

Run(Span, GenericRunConfig<Head, Leaf>)

§

Sequence(Span, Vec<GenericSchedule<Head, Leaf>>)

Trait Implementations§

source§

impl<Head: Clone, Leaf: Clone> Clone for GenericSchedule<Head, Leaf>

source§

fn clone(&self) -> GenericSchedule<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Head: Debug, Leaf: Debug> Debug for GenericSchedule<Head, Leaf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head: Display, Leaf: Display> Display for GenericSchedule<Head, Leaf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head: Hash, Leaf: Hash> Hash for GenericSchedule<Head, Leaf>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<Head: PartialEq, Leaf: PartialEq> PartialEq for GenericSchedule<Head, Leaf>

source§

fn eq(&self, other: &GenericSchedule<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl<Head: Display, Leaf: Display> ToSexp for GenericSchedule<Head, Leaf>

source§

fn to_sexp(&self) -> Sexp

source§

impl<Head: Eq, Leaf: Eq> Eq for GenericSchedule<Head, Leaf>

source§

impl<Head, Leaf> StructuralPartialEq for GenericSchedule<Head, Leaf>

Auto Trait Implementations§

§

impl<Head, Leaf> Freeze for GenericSchedule<Head, Leaf>

§

impl<Head, Leaf> RefUnwindSafe for GenericSchedule<Head, Leaf>
where + Leaf: RefUnwindSafe, + Head: RefUnwindSafe,

§

impl<Head, Leaf> Send for GenericSchedule<Head, Leaf>
where + Leaf: Send, + Head: Send,

§

impl<Head, Leaf> Sync for GenericSchedule<Head, Leaf>
where + Leaf: Sync, + Head: Sync,

§

impl<Head, Leaf> Unpin for GenericSchedule<Head, Leaf>
where + Leaf: Unpin, + Head: Unpin,

§

impl<Head, Leaf> UnwindSafe for GenericSchedule<Head, Leaf>
where + Leaf: UnwindSafe, + Head: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/enum.Literal.html b/docs/egglog/ast/enum.Literal.html new file mode 100644 index 00000000..43e5d328 --- /dev/null +++ b/docs/egglog/ast/enum.Literal.html @@ -0,0 +1,33 @@ +Literal in egglog::ast - Rust

Enum egglog::ast::Literal

source ·
pub enum Literal {
+    Int(i64),
+    F64(OrderedFloat<f64>),
+    String(Symbol),
+    Bool(bool),
+    Unit,
+}

Variants§

§

Int(i64)

§

F64(OrderedFloat<f64>)

§

String(Symbol)

§

Bool(bool)

§

Unit

Trait Implementations§

source§

impl Clone for Literal

source§

fn clone(&self) -> Literal

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Literal

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Literal

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<GlobalSymbol> for Literal

source§

fn from(t: Symbol) -> Self

Converts to this type from the input type.
source§

impl From<Literal> for Symbol

source§

fn from(literal: Literal) -> Self

Converts to this type from the input type.
source§

impl From<Literal> for OrderedFloat<f64>

source§

fn from(literal: Literal) -> Self

Converts to this type from the input type.
source§

impl From<Literal> for i64

source§

fn from(literal: Literal) -> Self

Converts to this type from the input type.
source§

impl From<OrderedFloat<f64>> for Literal

source§

fn from(t: OrderedFloat<f64>) -> Self

Converts to this type from the input type.
source§

impl From<i64> for Literal

source§

fn from(t: i64) -> Self

Converts to this type from the input type.
source§

impl Hash for Literal

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Literal

source§

fn cmp(&self, other: &Literal) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Literal

source§

fn eq(&self, other: &Literal) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Literal

source§

fn partial_cmp(&self, other: &Literal) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for Literal

source§

impl StructuralPartialEq for Literal

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/enum.Subdatatypes.html b/docs/egglog/ast/enum.Subdatatypes.html new file mode 100644 index 00000000..27cf904d --- /dev/null +++ b/docs/egglog/ast/enum.Subdatatypes.html @@ -0,0 +1,20 @@ +Subdatatypes in egglog::ast - Rust

Enum egglog::ast::Subdatatypes

source ·
pub enum Subdatatypes {
+    Variants(Vec<Variant>),
+    NewSort(Symbol, Vec<Expr>),
+}

Variants§

§

Variants(Vec<Variant>)

§

NewSort(Symbol, Vec<Expr>)

Trait Implementations§

source§

impl Clone for Subdatatypes

source§

fn clone(&self) -> Subdatatypes

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Subdatatypes

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Subdatatypes

source§

fn eq(&self, other: &Subdatatypes) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Subdatatypes

source§

impl StructuralPartialEq for Subdatatypes

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/expr/enum.GenericExpr.html b/docs/egglog/ast/expr/enum.GenericExpr.html new file mode 100644 index 00000000..8dc9c635 --- /dev/null +++ b/docs/egglog/ast/expr/enum.GenericExpr.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../egglog/ast/enum.GenericExpr.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/ast/expr/enum.Literal.html b/docs/egglog/ast/expr/enum.Literal.html new file mode 100644 index 00000000..a25b001b --- /dev/null +++ b/docs/egglog/ast/expr/enum.Literal.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../egglog/ast/enum.Literal.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/ast/expr/struct.ResolvedVar.html b/docs/egglog/ast/expr/struct.ResolvedVar.html new file mode 100644 index 00000000..747c33f0 --- /dev/null +++ b/docs/egglog/ast/expr/struct.ResolvedVar.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../egglog/ast/struct.ResolvedVar.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/ast/expr/type.Expr.html b/docs/egglog/ast/expr/type.Expr.html new file mode 100644 index 00000000..52188933 --- /dev/null +++ b/docs/egglog/ast/expr/type.Expr.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../egglog/ast/type.Expr.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/ast/index.html b/docs/egglog/ast/index.html new file mode 100644 index 00000000..a13129b4 --- /dev/null +++ b/docs/egglog/ast/index.html @@ -0,0 +1,9 @@ +egglog::ast - Rust

Module egglog::ast

source ·

Re-exports§

Modules§

Structs§

Enums§

Traits§

Type Aliases§

\ No newline at end of file diff --git a/docs/egglog/ast/parse/enum.ParseError.html b/docs/egglog/ast/parse/enum.ParseError.html new file mode 100644 index 00000000..6aea2218 --- /dev/null +++ b/docs/egglog/ast/parse/enum.ParseError.html @@ -0,0 +1,24 @@ +ParseError in egglog::ast::parse - Rust

Enum egglog::ast::parse::ParseError

source ·
pub enum ParseError {
+    Text(Span, String),
+    String(Span),
+    MissingEndQuote(Span),
+    EndOfFile(Span),
+    Ident(Span),
+    Int(Span),
+    Uint(Span),
+    Float(Span),
+    Bool(Span),
+    EqFactLt2(Span),
+}

Variants§

§

Text(Span, String)

§

String(Span)

§

MissingEndQuote(Span)

§

EndOfFile(Span)

§

Ident(Span)

§

Int(Span)

§

Uint(Span)

§

Float(Span)

§

Bool(Span)

§

EqFactLt2(Span)

Trait Implementations§

source§

impl Debug for ParseError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ParseError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ParseError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<ParseError> for Error

source§

fn from(source: ParseError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/parse/fn.parse_expr.html b/docs/egglog/ast/parse/fn.parse_expr.html new file mode 100644 index 00000000..9a3252bf --- /dev/null +++ b/docs/egglog/ast/parse/fn.parse_expr.html @@ -0,0 +1,4 @@ +parse_expr in egglog::ast::parse - Rust

Function egglog::ast::parse::parse_expr

source ·
pub fn parse_expr(
+    filename: Option<String>,
+    input: &str
+) -> Result<Expr, ParseError>
\ No newline at end of file diff --git a/docs/egglog/ast/parse/fn.parse_program.html b/docs/egglog/ast/parse/fn.parse_program.html new file mode 100644 index 00000000..599649da --- /dev/null +++ b/docs/egglog/ast/parse/fn.parse_program.html @@ -0,0 +1,4 @@ +parse_program in egglog::ast::parse - Rust

Function egglog::ast::parse::parse_program

source ·
pub fn parse_program(
+    filename: Option<String>,
+    input: &str
+) -> Result<Vec<Command>, ParseError>
\ No newline at end of file diff --git a/docs/egglog/ast/parse/index.html b/docs/egglog/ast/parse/index.html new file mode 100644 index 00000000..56fffa54 --- /dev/null +++ b/docs/egglog/ast/parse/index.html @@ -0,0 +1,2 @@ +egglog::ast::parse - Rust

Module egglog::ast::parse

source ·
Expand description

Parse a string into egglog.

+

Structs§

  • A Span contains the file name and a pair of offsets representing the start and the end.

Enums§

Functions§

\ No newline at end of file diff --git a/docs/egglog/ast/parse/sidebar-items.js b/docs/egglog/ast/parse/sidebar-items.js new file mode 100644 index 00000000..1b20bf19 --- /dev/null +++ b/docs/egglog/ast/parse/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["ParseError"],"fn":["parse_expr","parse_program"],"struct":["DUMMY_SPAN","Span"]}; \ No newline at end of file diff --git a/docs/egglog/ast/parse/struct.DUMMY_SPAN.html b/docs/egglog/ast/parse/struct.DUMMY_SPAN.html new file mode 100644 index 00000000..25504027 --- /dev/null +++ b/docs/egglog/ast/parse/struct.DUMMY_SPAN.html @@ -0,0 +1,12 @@ +DUMMY_SPAN in egglog::ast::parse - Rust

Struct egglog::ast::parse::DUMMY_SPAN

source ·
pub struct DUMMY_SPAN { /* private fields */ }

Methods from Deref<Target = Span>§

source

pub fn string(&self) -> &str

Trait Implementations§

source§

impl Deref for DUMMY_SPAN

§

type Target = Span

The resulting type after dereferencing.
source§

fn deref(&self) -> &Span

Dereferences the value.
source§

impl LazyStatic for DUMMY_SPAN

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/parse/struct.Span.html b/docs/egglog/ast/parse/struct.Span.html new file mode 100644 index 00000000..256407ba --- /dev/null +++ b/docs/egglog/ast/parse/struct.Span.html @@ -0,0 +1,21 @@ +Span in egglog::ast::parse - Rust

Struct egglog::ast::parse::Span

source ·
pub struct Span(/* private fields */);
Expand description

A Span contains the file name and a pair of offsets representing the start and the end.

+

Implementations§

source§

impl Span

source

pub fn string(&self) -> &str

Trait Implementations§

source§

impl Clone for Span

source§

fn clone(&self) -> Span

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Span

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Span

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for Span

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Span

source§

fn eq(&self, other: &Span) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Span

source§

impl StructuralPartialEq for Span

Auto Trait Implementations§

§

impl Freeze for Span

§

impl RefUnwindSafe for Span

§

impl Send for Span

§

impl Sync for Span

§

impl Unpin for Span

§

impl UnwindSafe for Span

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/sidebar-items.js b/docs/egglog/ast/sidebar-items.js new file mode 100644 index 00000000..1987174d --- /dev/null +++ b/docs/egglog/ast/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Change","GenericAction","GenericCommand","GenericExpr","GenericFact","GenericNCommand","GenericSchedule","Literal","Subdatatypes"],"mod":["desugar","parse"],"struct":["CorrespondingVar","Facts","GenericActions","GenericFunctionDecl","GenericRewrite","GenericRule","GenericRunConfig","IdentSort","ResolvedVar","Schema","Symbol","Variant"],"trait":["ToSexp"],"type":["Action","Actions","Command","Expr","Fact","FunctionDecl","NCommand","Rewrite","Rule","RunConfig","Schedule","Subsume"]}; \ No newline at end of file diff --git a/docs/egglog/ast/struct.CorrespondingVar.html b/docs/egglog/ast/struct.CorrespondingVar.html new file mode 100644 index 00000000..cec3cf57 --- /dev/null +++ b/docs/egglog/ast/struct.CorrespondingVar.html @@ -0,0 +1,53 @@ +CorrespondingVar in egglog::ast - Rust

Struct egglog::ast::CorrespondingVar

source ·
pub struct CorrespondingVar<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + PartialEq + Eq + Display + Hash,
{ + pub head: Head, + pub to: Leaf, +}

Fields§

§head: Head§to: Leaf

Implementations§

source§

impl<Head, Leaf> CorrespondingVar<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + PartialEq + Eq + Display + Hash,

source

pub fn new(head: Head, leaf: Leaf) -> Self

Trait Implementations§

source§

impl<Head, Leaf> Clone for CorrespondingVar<Head, Leaf>
where + Head: Clone + Display + Clone, + Leaf: Clone + PartialEq + Eq + Display + Hash + Clone,

source§

fn clone(&self) -> CorrespondingVar<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Head, Leaf> Debug for CorrespondingVar<Head, Leaf>
where + Head: Clone + Display + Debug, + Leaf: Clone + PartialEq + Eq + Display + Hash + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head, Leaf> Display for CorrespondingVar<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + PartialEq + Eq + Display + Hash,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head, Leaf> Hash for CorrespondingVar<Head, Leaf>
where + Head: Clone + Display + Hash, + Leaf: Clone + PartialEq + Eq + Display + Hash + Hash,

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<Head, Leaf> PartialEq for CorrespondingVar<Head, Leaf>
where + Head: Clone + Display + PartialEq, + Leaf: Clone + PartialEq + Eq + Display + Hash + PartialEq,

source§

fn eq(&self, other: &CorrespondingVar<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl<Head, Leaf> Eq for CorrespondingVar<Head, Leaf>
where + Head: Clone + Display + Eq, + Leaf: Clone + PartialEq + Eq + Display + Hash + Eq,

source§

impl<Head, Leaf> StructuralPartialEq for CorrespondingVar<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + PartialEq + Eq + Display + Hash,

Auto Trait Implementations§

§

impl<Head, Leaf> Freeze for CorrespondingVar<Head, Leaf>
where + Head: Freeze, + Leaf: Freeze,

§

impl<Head, Leaf> RefUnwindSafe for CorrespondingVar<Head, Leaf>
where + Head: RefUnwindSafe, + Leaf: RefUnwindSafe,

§

impl<Head, Leaf> Send for CorrespondingVar<Head, Leaf>
where + Head: Send, + Leaf: Send,

§

impl<Head, Leaf> Sync for CorrespondingVar<Head, Leaf>
where + Head: Sync, + Leaf: Sync,

§

impl<Head, Leaf> Unpin for CorrespondingVar<Head, Leaf>
where + Head: Unpin, + Leaf: Unpin,

§

impl<Head, Leaf> UnwindSafe for CorrespondingVar<Head, Leaf>
where + Head: UnwindSafe, + Leaf: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/struct.Facts.html b/docs/egglog/ast/struct.Facts.html new file mode 100644 index 00000000..70c5098a --- /dev/null +++ b/docs/egglog/ast/struct.Facts.html @@ -0,0 +1,22 @@ +Facts in egglog::ast - Rust

Struct egglog::ast::Facts

source ·
pub struct Facts<Head, Leaf>(pub Vec<GenericFact<Head, Leaf>>);

Tuple Fields§

§0: Vec<GenericFact<Head, Leaf>>

Auto Trait Implementations§

§

impl<Head, Leaf> Freeze for Facts<Head, Leaf>

§

impl<Head, Leaf> RefUnwindSafe for Facts<Head, Leaf>
where + Leaf: RefUnwindSafe, + Head: RefUnwindSafe,

§

impl<Head, Leaf> Send for Facts<Head, Leaf>
where + Leaf: Send, + Head: Send,

§

impl<Head, Leaf> Sync for Facts<Head, Leaf>
where + Leaf: Sync, + Head: Sync,

§

impl<Head, Leaf> Unpin for Facts<Head, Leaf>
where + Leaf: Unpin, + Head: Unpin,

§

impl<Head, Leaf> UnwindSafe for Facts<Head, Leaf>
where + Leaf: UnwindSafe, + Head: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/struct.GenericActions.html b/docs/egglog/ast/struct.GenericActions.html new file mode 100644 index 00000000..de6b887e --- /dev/null +++ b/docs/egglog/ast/struct.GenericActions.html @@ -0,0 +1,33 @@ +GenericActions in egglog::ast - Rust

Struct egglog::ast::GenericActions

source ·
pub struct GenericActions<Head: Clone + Display, Leaf: Clone + PartialEq + Eq + Display + Hash>(pub Vec<GenericAction<Head, Leaf>>);

Tuple Fields§

§0: Vec<GenericAction<Head, Leaf>>

Implementations§

source§

impl<Head, Leaf> GenericActions<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + PartialEq + Eq + Display + Hash,

source

pub fn new(actions: Vec<GenericAction<Head, Leaf>>) -> Self

source

pub fn singleton(action: GenericAction<Head, Leaf>) -> Self

Trait Implementations§

source§

impl<Head: Clone + Clone + Display, Leaf: Clone + Clone + PartialEq + Eq + Display + Hash> Clone for GenericActions<Head, Leaf>

source§

fn clone(&self) -> GenericActions<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Head: Debug + Clone + Display, Leaf: Debug + Clone + PartialEq + Eq + Display + Hash> Debug for GenericActions<Head, Leaf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head, Leaf> Default for GenericActions<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + PartialEq + Eq + Display + Hash,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<Head: Hash + Clone + Display, Leaf: Hash + Clone + PartialEq + Eq + Display + Hash> Hash for GenericActions<Head, Leaf>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<Head: PartialEq + Clone + Display, Leaf: PartialEq + Clone + PartialEq + Eq + Display + Hash> PartialEq for GenericActions<Head, Leaf>

source§

fn eq(&self, other: &GenericActions<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl<Head: Eq + Clone + Display, Leaf: Eq + Clone + PartialEq + Eq + Display + Hash> Eq for GenericActions<Head, Leaf>

source§

impl<Head: Clone + Display, Leaf: Clone + PartialEq + Eq + Display + Hash> StructuralPartialEq for GenericActions<Head, Leaf>

Auto Trait Implementations§

§

impl<Head, Leaf> Freeze for GenericActions<Head, Leaf>

§

impl<Head, Leaf> RefUnwindSafe for GenericActions<Head, Leaf>
where + Leaf: RefUnwindSafe, + Head: RefUnwindSafe,

§

impl<Head, Leaf> Send for GenericActions<Head, Leaf>
where + Leaf: Send, + Head: Send,

§

impl<Head, Leaf> Sync for GenericActions<Head, Leaf>
where + Leaf: Sync, + Head: Sync,

§

impl<Head, Leaf> Unpin for GenericActions<Head, Leaf>
where + Leaf: Unpin, + Head: Unpin,

§

impl<Head, Leaf> UnwindSafe for GenericActions<Head, Leaf>
where + Leaf: UnwindSafe, + Head: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/struct.GenericFunctionDecl.html b/docs/egglog/ast/struct.GenericFunctionDecl.html new file mode 100644 index 00000000..755259bf --- /dev/null +++ b/docs/egglog/ast/struct.GenericFunctionDecl.html @@ -0,0 +1,66 @@ +GenericFunctionDecl in egglog::ast - Rust

Struct egglog::ast::GenericFunctionDecl

source ·
pub struct GenericFunctionDecl<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + PartialEq + Eq + Display + Hash,
{ + pub name: Symbol, + pub schema: Schema, + pub default: Option<GenericExpr<Head, Leaf>>, + pub merge: Option<GenericExpr<Head, Leaf>>, + pub merge_action: GenericActions<Head, Leaf>, + pub cost: Option<usize>, + pub unextractable: bool, + pub ignore_viz: bool, + pub span: Span, +}
Expand description

Represents the declaration of a function +directly parsed from source syntax.

+

Fields§

§name: Symbol§schema: Schema§default: Option<GenericExpr<Head, Leaf>>§merge: Option<GenericExpr<Head, Leaf>>§merge_action: GenericActions<Head, Leaf>§cost: Option<usize>§unextractable: bool§ignore_viz: bool

Globals are desugared to functions, with this flag set to true. +This is used by visualization to handle globals differently.

+
§span: Span

Implementations§

source§

impl GenericFunctionDecl<GlobalSymbol, GlobalSymbol>

source

pub fn relation(span: Span, name: Symbol, input: Vec<Symbol>) -> Self

source§

impl<Head, Leaf> GenericFunctionDecl<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + PartialEq + Eq + Display + Hash,

source

pub fn visit_exprs( + self, + f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf> +) -> GenericFunctionDecl<Head, Leaf>

Trait Implementations§

source§

impl<Head, Leaf> Clone for GenericFunctionDecl<Head, Leaf>
where + Head: Clone + Display + Clone, + Leaf: Clone + PartialEq + Eq + Display + Hash + Clone,

source§

fn clone(&self) -> GenericFunctionDecl<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Head, Leaf> Debug for GenericFunctionDecl<Head, Leaf>
where + Head: Clone + Display + Debug, + Leaf: Clone + PartialEq + Eq + Display + Hash + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head, Leaf> Hash for GenericFunctionDecl<Head, Leaf>
where + Head: Clone + Display + Hash, + Leaf: Clone + PartialEq + Eq + Display + Hash + Hash,

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<Head, Leaf> PartialEq for GenericFunctionDecl<Head, Leaf>
where + Head: Clone + Display + PartialEq, + Leaf: Clone + PartialEq + Eq + Display + Hash + PartialEq,

source§

fn eq(&self, other: &GenericFunctionDecl<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl<Head, Leaf> ToSexp for GenericFunctionDecl<Head, Leaf>
where + Head: Clone + Display + ToSexp, + Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source§

fn to_sexp(&self) -> Sexp

source§

impl<Head, Leaf> Eq for GenericFunctionDecl<Head, Leaf>
where + Head: Clone + Display + Eq, + Leaf: Clone + PartialEq + Eq + Display + Hash + Eq,

source§

impl<Head, Leaf> StructuralPartialEq for GenericFunctionDecl<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + PartialEq + Eq + Display + Hash,

Auto Trait Implementations§

§

impl<Head, Leaf> Freeze for GenericFunctionDecl<Head, Leaf>
where + Leaf: Freeze, + Head: Freeze,

§

impl<Head, Leaf> RefUnwindSafe for GenericFunctionDecl<Head, Leaf>
where + Leaf: RefUnwindSafe, + Head: RefUnwindSafe,

§

impl<Head, Leaf> Send for GenericFunctionDecl<Head, Leaf>
where + Leaf: Send, + Head: Send,

§

impl<Head, Leaf> Sync for GenericFunctionDecl<Head, Leaf>
where + Leaf: Sync, + Head: Sync,

§

impl<Head, Leaf> Unpin for GenericFunctionDecl<Head, Leaf>
where + Leaf: Unpin, + Head: Unpin,

§

impl<Head, Leaf> UnwindSafe for GenericFunctionDecl<Head, Leaf>
where + Leaf: UnwindSafe, + Head: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/struct.GenericRewrite.html b/docs/egglog/ast/struct.GenericRewrite.html new file mode 100644 index 00000000..c8e0a3d1 --- /dev/null +++ b/docs/egglog/ast/struct.GenericRewrite.html @@ -0,0 +1,37 @@ +GenericRewrite in egglog::ast - Rust

Struct egglog::ast::GenericRewrite

source ·
pub struct GenericRewrite<Head, Leaf> {
+    pub span: Span,
+    pub lhs: GenericExpr<Head, Leaf>,
+    pub rhs: GenericExpr<Head, Leaf>,
+    pub conditions: Vec<GenericFact<Head, Leaf>>,
+}

Fields§

§span: Span§lhs: GenericExpr<Head, Leaf>§rhs: GenericExpr<Head, Leaf>§conditions: Vec<GenericFact<Head, Leaf>>

Implementations§

source§

impl<Head: Display, Leaf: Display> GenericRewrite<Head, Leaf>

source

pub fn to_sexp( + &self, + ruleset: Symbol, + is_bidirectional: bool, + subsume: bool +) -> Sexp

Converts the rewrite into an s-expression.

+

Trait Implementations§

source§

impl<Head: Clone, Leaf: Clone> Clone for GenericRewrite<Head, Leaf>

source§

fn clone(&self) -> GenericRewrite<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Head: Debug, Leaf: Debug> Debug for GenericRewrite<Head, Leaf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head: Display, Leaf: Display> Display for GenericRewrite<Head, Leaf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Head, Leaf> Freeze for GenericRewrite<Head, Leaf>
where + Leaf: Freeze, + Head: Freeze,

§

impl<Head, Leaf> RefUnwindSafe for GenericRewrite<Head, Leaf>
where + Leaf: RefUnwindSafe, + Head: RefUnwindSafe,

§

impl<Head, Leaf> Send for GenericRewrite<Head, Leaf>
where + Leaf: Send, + Head: Send,

§

impl<Head, Leaf> Sync for GenericRewrite<Head, Leaf>
where + Leaf: Sync, + Head: Sync,

§

impl<Head, Leaf> Unpin for GenericRewrite<Head, Leaf>
where + Leaf: Unpin, + Head: Unpin,

§

impl<Head, Leaf> UnwindSafe for GenericRewrite<Head, Leaf>
where + Leaf: UnwindSafe, + Head: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/struct.GenericRule.html b/docs/egglog/ast/struct.GenericRule.html new file mode 100644 index 00000000..ae512b71 --- /dev/null +++ b/docs/egglog/ast/struct.GenericRule.html @@ -0,0 +1,53 @@ +GenericRule in egglog::ast - Rust

Struct egglog::ast::GenericRule

source ·
pub struct GenericRule<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + PartialEq + Eq + Display + Hash,
{ + pub span: Span, + pub head: GenericActions<Head, Leaf>, + pub body: Vec<GenericFact<Head, Leaf>>, +}

Fields§

§span: Span§head: GenericActions<Head, Leaf>§body: Vec<GenericFact<Head, Leaf>>

Implementations§

source§

impl<Head, Leaf> GenericRule<Head, Leaf>
where + Head: Clone + Display + ToSexp, + Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source

pub fn to_sexp(&self, ruleset: Symbol, name: Symbol) -> Sexp

Converts this rule into an s-expression.

+

Trait Implementations§

source§

impl<Head, Leaf> Clone for GenericRule<Head, Leaf>
where + Head: Clone + Display + Clone, + Leaf: Clone + PartialEq + Eq + Display + Hash + Clone,

source§

fn clone(&self) -> GenericRule<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Head, Leaf> Debug for GenericRule<Head, Leaf>
where + Head: Clone + Display + Debug, + Leaf: Clone + PartialEq + Eq + Display + Hash + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head, Leaf> Display for GenericRule<Head, Leaf>
where + Head: Clone + Display + ToSexp, + Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head, Leaf> Hash for GenericRule<Head, Leaf>
where + Head: Clone + Display + Hash, + Leaf: Clone + PartialEq + Eq + Display + Hash + Hash,

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<Head, Leaf> PartialEq for GenericRule<Head, Leaf>
where + Head: Clone + Display + PartialEq, + Leaf: Clone + PartialEq + Eq + Display + Hash + PartialEq,

source§

fn eq(&self, other: &GenericRule<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl<Head, Leaf> Eq for GenericRule<Head, Leaf>
where + Head: Clone + Display + Eq, + Leaf: Clone + PartialEq + Eq + Display + Hash + Eq,

source§

impl<Head, Leaf> StructuralPartialEq for GenericRule<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + PartialEq + Eq + Display + Hash,

Auto Trait Implementations§

§

impl<Head, Leaf> Freeze for GenericRule<Head, Leaf>

§

impl<Head, Leaf> RefUnwindSafe for GenericRule<Head, Leaf>
where + Leaf: RefUnwindSafe, + Head: RefUnwindSafe,

§

impl<Head, Leaf> Send for GenericRule<Head, Leaf>
where + Leaf: Send, + Head: Send,

§

impl<Head, Leaf> Sync for GenericRule<Head, Leaf>
where + Leaf: Sync, + Head: Sync,

§

impl<Head, Leaf> Unpin for GenericRule<Head, Leaf>
where + Leaf: Unpin, + Head: Unpin,

§

impl<Head, Leaf> UnwindSafe for GenericRule<Head, Leaf>
where + Leaf: UnwindSafe, + Head: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/struct.GenericRunConfig.html b/docs/egglog/ast/struct.GenericRunConfig.html new file mode 100644 index 00000000..fc8eb2e5 --- /dev/null +++ b/docs/egglog/ast/struct.GenericRunConfig.html @@ -0,0 +1,39 @@ +GenericRunConfig in egglog::ast - Rust

Struct egglog::ast::GenericRunConfig

source ·
pub struct GenericRunConfig<Head, Leaf> {
+    pub ruleset: Symbol,
+    pub until: Option<Vec<GenericFact<Head, Leaf>>>,
+}

Fields§

§ruleset: Symbol§until: Option<Vec<GenericFact<Head, Leaf>>>

Implementations§

source§

impl<Head, Leaf> GenericRunConfig<Head, Leaf>
where + Head: Clone + Display, + Leaf: Clone + PartialEq + Eq + Display + Hash,

source

pub fn visit_exprs( + self, + f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf> +) -> Self

Trait Implementations§

source§

impl<Head: Clone, Leaf: Clone> Clone for GenericRunConfig<Head, Leaf>

source§

fn clone(&self) -> GenericRunConfig<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Head: Debug, Leaf: Debug> Debug for GenericRunConfig<Head, Leaf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Head: Hash, Leaf: Hash> Hash for GenericRunConfig<Head, Leaf>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<Head: PartialEq, Leaf: PartialEq> PartialEq for GenericRunConfig<Head, Leaf>

source§

fn eq(&self, other: &GenericRunConfig<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl<Head, Leaf> ToSexp for GenericRunConfig<Head, Leaf>
where + Head: Display, + Leaf: Display,

source§

fn to_sexp(&self) -> Sexp

source§

impl<Head: Eq, Leaf: Eq> Eq for GenericRunConfig<Head, Leaf>

source§

impl<Head, Leaf> StructuralPartialEq for GenericRunConfig<Head, Leaf>

Auto Trait Implementations§

§

impl<Head, Leaf> Freeze for GenericRunConfig<Head, Leaf>

§

impl<Head, Leaf> RefUnwindSafe for GenericRunConfig<Head, Leaf>
where + Leaf: RefUnwindSafe, + Head: RefUnwindSafe,

§

impl<Head, Leaf> Send for GenericRunConfig<Head, Leaf>
where + Leaf: Send, + Head: Send,

§

impl<Head, Leaf> Sync for GenericRunConfig<Head, Leaf>
where + Leaf: Sync, + Head: Sync,

§

impl<Head, Leaf> Unpin for GenericRunConfig<Head, Leaf>
where + Leaf: Unpin, + Head: Unpin,

§

impl<Head, Leaf> UnwindSafe for GenericRunConfig<Head, Leaf>
where + Leaf: UnwindSafe, + Head: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/struct.IdentSort.html b/docs/egglog/ast/struct.IdentSort.html new file mode 100644 index 00000000..c9a3f961 --- /dev/null +++ b/docs/egglog/ast/struct.IdentSort.html @@ -0,0 +1,23 @@ +IdentSort in egglog::ast - Rust

Struct egglog::ast::IdentSort

source ·
pub struct IdentSort {
+    pub ident: Symbol,
+    pub sort: Symbol,
+}

Fields§

§ident: Symbol§sort: Symbol

Trait Implementations§

source§

impl Clone for IdentSort

source§

fn clone(&self) -> IdentSort

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for IdentSort

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for IdentSort

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for IdentSort

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for IdentSort

source§

fn eq(&self, other: &IdentSort) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl ToSexp for IdentSort

source§

fn to_sexp(&self) -> Sexp

source§

impl Eq for IdentSort

source§

impl StructuralPartialEq for IdentSort

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/struct.ResolvedVar.html b/docs/egglog/ast/struct.ResolvedVar.html new file mode 100644 index 00000000..07f032e7 --- /dev/null +++ b/docs/egglog/ast/struct.ResolvedVar.html @@ -0,0 +1,30 @@ +ResolvedVar in egglog::ast - Rust

Struct egglog::ast::ResolvedVar

source ·
pub struct ResolvedVar {
+    pub name: Symbol,
+    pub sort: ArcSort,
+    pub is_global_ref: bool,
+}

Fields§

§name: Symbol§sort: ArcSort§is_global_ref: bool

Is this a reference to a global variable? +After the remove_globals pass, this should be false.

+

NB: we distinguish between a global reference and a global binding. +The current implementation of Eq and Hash does not take this field +into consideration. +Overall, the definition of equality between two ResolvedVars is dicey.

+

Trait Implementations§

source§

impl Clone for ResolvedVar

source§

fn clone(&self) -> ResolvedVar

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ResolvedVar

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ResolvedVar

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for ResolvedVar

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ResolvedVar

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl ToSexp for ResolvedVar

source§

fn to_sexp(&self) -> Sexp

source§

impl Eq for ResolvedVar

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/struct.Schema.html b/docs/egglog/ast/struct.Schema.html new file mode 100644 index 00000000..4c6f7b61 --- /dev/null +++ b/docs/egglog/ast/struct.Schema.html @@ -0,0 +1,22 @@ +Schema in egglog::ast - Rust

Struct egglog::ast::Schema

source ·
pub struct Schema {
+    pub input: Vec<Symbol>,
+    pub output: Symbol,
+}

Fields§

§input: Vec<Symbol>§output: Symbol

Implementations§

source§

impl Schema

source

pub fn new(input: Vec<Symbol>, output: Symbol) -> Self

Trait Implementations§

source§

impl Clone for Schema

source§

fn clone(&self) -> Schema

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Schema

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for Schema

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Schema

source§

fn eq(&self, other: &Schema) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl ToSexp for Schema

source§

fn to_sexp(&self) -> Sexp

source§

impl Eq for Schema

source§

impl StructuralPartialEq for Schema

Auto Trait Implementations§

§

impl Freeze for Schema

§

impl RefUnwindSafe for Schema

§

impl Send for Schema

§

impl Sync for Schema

§

impl Unpin for Schema

§

impl UnwindSafe for Schema

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/struct.Symbol.html b/docs/egglog/ast/struct.Symbol.html new file mode 100644 index 00000000..009a1eff --- /dev/null +++ b/docs/egglog/ast/struct.Symbol.html @@ -0,0 +1,40 @@ +Symbol in egglog::ast - Rust

Struct egglog::ast::Symbol

pub struct Symbol(/* private fields */);
Expand description

A interned string in the global symbol table.

+

This requires the global feature on the crate.

+

GlobalSymbol is a wrapper around [Symbol] that knows to refer to a +built-in, global [SymbolTable]. Strings into the global table are never freed.

+

This enables a lot of convenience methods and trait implementations over +GlobalSymbol (see below). In particular, +you can convert it to &'static str, +convert From and Into a &str, +and de/serialize using serde if the serde feature is enabled.

+

Implementations§

§

impl GlobalSymbol

pub fn new(s: impl AsRef<str>) -> GlobalSymbol

Intern a string into the global symbol table.

+

pub fn as_str(&self) -> &'static str

Convert this symbol into the string in the static, global symbol table.

+

Trait Implementations§

§

impl Clone for GlobalSymbol

§

fn clone(&self) -> GlobalSymbol

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for GlobalSymbol

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for GlobalSymbol

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl FreshGen<GlobalSymbol, GlobalSymbol> for SymbolGen

source§

fn fresh(&mut self, name_hint: &Symbol) -> Symbol

§

impl From<&String> for GlobalSymbol

§

fn from(s: &String) -> GlobalSymbol

Converts to this type from the input type.
§

impl From<&str> for GlobalSymbol

§

fn from(s: &str) -> GlobalSymbol

Converts to this type from the input type.
§

impl From<GlobalSymbol> for &'static str

§

fn from(sym: GlobalSymbol) -> &'static str

Converts to this type from the input type.
source§

impl From<GlobalSymbol> for Literal

source§

fn from(t: Symbol) -> Self

Converts to this type from the input type.
source§

impl From<GlobalSymbol> for Value

source§

fn from(s: Symbol) -> Self

Converts to this type from the input type.
source§

impl From<Literal> for Symbol

source§

fn from(literal: Literal) -> Self

Converts to this type from the input type.
§

impl From<NonZero<u32>> for GlobalSymbol

§

fn from(n: NonZero<u32>) -> GlobalSymbol

Converts to this type from the input type.
§

impl From<String> for GlobalSymbol

§

fn from(s: String) -> GlobalSymbol

Converts to this type from the input type.
source§

impl FromSort for Symbol

§

type Sort = StringSort

source§

fn load(_sort: &Self::Sort, value: &Value) -> Self

§

impl FromStr for GlobalSymbol

§

type Err = Infallible

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<GlobalSymbol, <GlobalSymbol as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Hash for GlobalSymbol

§

fn hash<__H>(&self, state: &mut __H)
where + __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl IntoSort for Symbol

§

type Sort = StringSort

source§

fn store(self, _sort: &Self::Sort) -> Option<Value>

§

impl Ord for GlobalSymbol

§

fn cmp(&self, other: &GlobalSymbol) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for GlobalSymbol

§

fn eq(&self, other: &GlobalSymbol) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for GlobalSymbol

§

fn partial_cmp(&self, other: &GlobalSymbol) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl ToSexp for Symbol

source§

fn to_sexp(&self) -> Sexp

§

impl Copy for GlobalSymbol

§

impl Eq for GlobalSymbol

§

impl StructuralPartialEq for GlobalSymbol

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> RuleType for T
where + T: Copy + Debug + Eq + Hash + Ord,

\ No newline at end of file diff --git a/docs/egglog/ast/struct.Variant.html b/docs/egglog/ast/struct.Variant.html new file mode 100644 index 00000000..6b0acbe3 --- /dev/null +++ b/docs/egglog/ast/struct.Variant.html @@ -0,0 +1,24 @@ +Variant in egglog::ast - Rust

Struct egglog::ast::Variant

source ·
pub struct Variant {
+    pub span: Span,
+    pub name: Symbol,
+    pub types: Vec<Symbol>,
+    pub cost: Option<usize>,
+}

Fields§

§span: Span§name: Symbol§types: Vec<Symbol>§cost: Option<usize>

Trait Implementations§

source§

impl Clone for Variant

source§

fn clone(&self) -> Variant

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Variant

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for Variant

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Variant

source§

fn eq(&self, other: &Variant) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl ToSexp for Variant

source§

fn to_sexp(&self) -> Sexp

source§

impl Eq for Variant

source§

impl StructuralPartialEq for Variant

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/ast/trait.ToSexp.html b/docs/egglog/ast/trait.ToSexp.html new file mode 100644 index 00000000..8a609163 --- /dev/null +++ b/docs/egglog/ast/trait.ToSexp.html @@ -0,0 +1,14 @@ +ToSexp in egglog::ast - Rust

Trait egglog::ast::ToSexp

source ·
pub trait ToSexp {
+    // Required method
+    fn to_sexp(&self) -> Sexp;
+}

Required Methods§

source

fn to_sexp(&self) -> Sexp

Implementations on Foreign Types§

source§

impl ToSexp for str

source§

fn to_sexp(&self) -> Sexp

source§

impl ToSexp for usize

source§

fn to_sexp(&self) -> Sexp

source§

impl ToSexp for Sexp

source§

fn to_sexp(&self) -> Sexp

Implementors§

source§

impl ToSexp for IdentSort

source§

impl ToSexp for ResolvedVar

source§

impl ToSexp for Schema

source§

impl ToSexp for Symbol

source§

impl ToSexp for Variant

source§

impl<Head, Leaf> ToSexp for GenericAction<Head, Leaf>
where + Head: Clone + Display + ToSexp, + Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source§

impl<Head, Leaf> ToSexp for GenericCommand<Head, Leaf>
where + Head: Clone + Display + ToSexp, + Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source§

impl<Head, Leaf> ToSexp for GenericFact<Head, Leaf>
where + Head: Display, + Leaf: Display,

source§

impl<Head, Leaf> ToSexp for GenericFunctionDecl<Head, Leaf>
where + Head: Clone + Display + ToSexp, + Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source§

impl<Head, Leaf> ToSexp for GenericRunConfig<Head, Leaf>
where + Head: Display, + Leaf: Display,

source§

impl<Head: Display, Leaf: Display> ToSexp for GenericSchedule<Head, Leaf>

\ No newline at end of file diff --git a/docs/egglog/ast/type.Action.html b/docs/egglog/ast/type.Action.html new file mode 100644 index 00000000..3cc56639 --- /dev/null +++ b/docs/egglog/ast/type.Action.html @@ -0,0 +1,33 @@ +Action in egglog::ast - Rust

Type Alias egglog::ast::Action

source ·
pub type Action = GenericAction<Symbol, Symbol>;

Aliased Type§

enum Action {
+    Let(Span, GlobalSymbol, GenericExpr<GlobalSymbol, GlobalSymbol>),
+    Set(Span, GlobalSymbol, Vec<GenericExpr<GlobalSymbol, GlobalSymbol>>, GenericExpr<GlobalSymbol, GlobalSymbol>),
+    Change(Span, Change, GlobalSymbol, Vec<GenericExpr<GlobalSymbol, GlobalSymbol>>),
+    Union(Span, GenericExpr<GlobalSymbol, GlobalSymbol>, GenericExpr<GlobalSymbol, GlobalSymbol>),
+    Extract(Span, GenericExpr<GlobalSymbol, GlobalSymbol>, GenericExpr<GlobalSymbol, GlobalSymbol>),
+    Panic(Span, String),
+    Expr(Span, GenericExpr<GlobalSymbol, GlobalSymbol>),
+}

Variants§

§

Let(Span, GlobalSymbol, GenericExpr<GlobalSymbol, GlobalSymbol>)

Bind a variable to a particular datatype or primitive. +At the top level (in a Command::Action), this defines a global variable. +In a Command::Rule, this defines a local variable in the actions.

+
§

Set(Span, GlobalSymbol, Vec<GenericExpr<GlobalSymbol, GlobalSymbol>>, GenericExpr<GlobalSymbol, GlobalSymbol>)

set a function to a particular result. +set should not be used on datatypes- +instead, use union.

+
§

Change(Span, Change, GlobalSymbol, Vec<GenericExpr<GlobalSymbol, GlobalSymbol>>)

Delete or subsume (mark as hidden from future rewrites and unextractable) an entry from a function.

+
§

Union(Span, GenericExpr<GlobalSymbol, GlobalSymbol>, GenericExpr<GlobalSymbol, GlobalSymbol>)

union two datatypes, making them equal +in the implicit, global equality relation +of egglog. +All rules match modulo this equality relation.

+

Example:

+
(datatype Math (Num i64))
+(union (Num 1) (Num 2)); Define that Num 1 and Num 2 are equivalent
+(extract (Num 1)); Extracts Num 1
+(extract (Num 2)); Extracts Num 1
+
§

Extract(Span, GenericExpr<GlobalSymbol, GlobalSymbol>, GenericExpr<GlobalSymbol, GlobalSymbol>)

extract a datatype from the egraph, choosing +the smallest representative. +By default, each constructor costs 1 to extract +(common subexpressions are not shared in the cost +model). +The second argument is the number of variants to +extract, picking different terms in the +same equivalence class.

+
§

Panic(Span, String)

§

Expr(Span, GenericExpr<GlobalSymbol, GlobalSymbol>)

\ No newline at end of file diff --git a/docs/egglog/ast/type.Actions.html b/docs/egglog/ast/type.Actions.html new file mode 100644 index 00000000..f600f69a --- /dev/null +++ b/docs/egglog/ast/type.Actions.html @@ -0,0 +1 @@ +Actions in egglog::ast - Rust

Type Alias egglog::ast::Actions

source ·
pub type Actions = GenericActions<Symbol, Symbol>;

Aliased Type§

struct Actions(pub Vec<GenericAction<GlobalSymbol, GlobalSymbol>>);

Fields§

§0: Vec<GenericAction<GlobalSymbol, GlobalSymbol>>
\ No newline at end of file diff --git a/docs/egglog/ast/type.Command.html b/docs/egglog/ast/type.Command.html new file mode 100644 index 00000000..8c8763bc --- /dev/null +++ b/docs/egglog/ast/type.Command.html @@ -0,0 +1,281 @@ +Command in egglog::ast - Rust

Type Alias egglog::ast::Command

source ·
pub type Command = GenericCommand<Symbol, Symbol>;

Aliased Type§

enum Command {
+
Show 25 variants SetOption { + name: GlobalSymbol, + value: GenericExpr<GlobalSymbol, GlobalSymbol>, + }, + Datatype { + span: Span, + name: GlobalSymbol, + variants: Vec<Variant>, + }, + Datatypes { + span: Span, + datatypes: Vec<(Span, GlobalSymbol, Subdatatypes)>, + }, + Sort(Span, GlobalSymbol, Option<(GlobalSymbol, Vec<GenericExpr<GlobalSymbol, GlobalSymbol>>)>), + Function(GenericFunctionDecl<GlobalSymbol, GlobalSymbol>), + Relation { + span: Span, + constructor: GlobalSymbol, + inputs: Vec<GlobalSymbol>, + }, + AddRuleset(GlobalSymbol), + UnstableCombinedRuleset(GlobalSymbol, Vec<GlobalSymbol>), + Rule { + name: GlobalSymbol, + ruleset: GlobalSymbol, + rule: GenericRule<GlobalSymbol, GlobalSymbol>, + }, + Rewrite(GlobalSymbol, GenericRewrite<GlobalSymbol, GlobalSymbol>, bool), + BiRewrite(GlobalSymbol, GenericRewrite<GlobalSymbol, GlobalSymbol>), + Action(GenericAction<GlobalSymbol, GlobalSymbol>), + RunSchedule(GenericSchedule<GlobalSymbol, GlobalSymbol>), + PrintOverallStatistics, + Simplify { + span: Span, + expr: GenericExpr<GlobalSymbol, GlobalSymbol>, + schedule: GenericSchedule<GlobalSymbol, GlobalSymbol>, + }, + QueryExtract { + span: Span, + variants: usize, + expr: GenericExpr<GlobalSymbol, GlobalSymbol>, + }, + Check(Span, Vec<GenericFact<GlobalSymbol, GlobalSymbol>>), + PrintFunction(Span, GlobalSymbol, usize), + PrintSize(Span, Option<GlobalSymbol>), + Input { + span: Span, + name: GlobalSymbol, + file: String, + }, + Output { + span: Span, + file: String, + exprs: Vec<GenericExpr<GlobalSymbol, GlobalSymbol>>, + }, + Push(usize), + Pop(Span, usize), + Fail(Span, Box<GenericCommand<GlobalSymbol, GlobalSymbol>>), + Include(Span, String), +
}

Variants§

§

SetOption

Egglog supports several experimental options +that can be set using the set-option command.

+

Options supported include:

+
    +
  • “interactive_mode” (default: false): when enabled, egglog prints “(done)” after each command, allowing an external +tool to know when each command has finished running.
  • +
+
§

Datatype

Declare a user-defined datatype. +Datatypes can be unioned with Action::Union either +at the top level or in the actions of a rule. +This makes them equal in the implicit, global equality relation. +Example:

+
(datatype Math
+  (Num i64)
+  (Var String)
+  (Add Math Math)
+  (Mul Math Math))
+
+

defines a simple Math datatype with variants for numbers, named variables, addition and multiplication.

+

Datatypes desugar directly to a Command::Sort and a Command::Function for each constructor. +The code above becomes:

+
(sort Math)
+(function Num (i64) Math)
+(function Var (String) Math)
+(function Add (Math Math) Math)
+(function Mul (Math Math) Math)
+Datatypes are also known as algebraic data types, tagged unions and sum types.

Fields

§span: Span
§variants: Vec<Variant>
§

Datatypes

Fields

§span: Span
§

Sort(Span, GlobalSymbol, Option<(GlobalSymbol, Vec<GenericExpr<GlobalSymbol, GlobalSymbol>>)>)

Create a new user-defined sort, which can then +be used in new Command::Function declarations. +The Command::Datatype command desugars directly to this command, with one Command::Function +per constructor. +The main use of this command (as opposed to using Command::Datatype) is for forward-declaring a sort for mutually-recursive datatypes.

+

It can also be used to create +a container sort. +For example, here’s how to make a sort for vectors +of some user-defined sort Math:

+
(sort MathVec (Vec Math))
+
+

Now MathVec can be used as an input or output sort.

+
§

Function(GenericFunctionDecl<GlobalSymbol, GlobalSymbol>)

Declare an egglog function, which is a database table with a +a functional dependency (also called a primary key) on its inputs to one output.

+
(function <name:Ident> <schema:Schema> <cost:Cost>
+       (:on_merge <List<Action>>)?
+       (:merge <Expr>)?
+       (:default <Expr>)?)
+
+

A function can have a cost for extraction. +It can also have a default value, which is used when calling the function.

+

Finally, it can have a merge and on_merge, which are triggered when +the function dependency is violated. +In this case, the merge expression determines which of the two outputs +for the same input is used. +The on_merge actions are run after the merge expression is evaluated.

+

Note that the :merge expression must be monotonic +for the behavior of the egglog program to be consistent and defined. +In other words, the merge function must define a lattice on the output of the function. +If values are merged in different orders, they should still result in the same output. +If the merge expression is not monotonic, the behavior can vary as +actions may be applied more than once with different results.

+

The function is a datatype when:

+
    +
  • The output is not a primitive
  • +
  • No merge function is provided
  • +
  • No default is provided
  • +
+

For example, the following is a datatype:

+
(function Add (i64 i64) Math)
+
+

However, this function is not:

+
(function LowerBound (Math) i64 :merge (max old new))
+
+

A datatype can be unioned with Action::Union +with another datatype of the same sort.

+

Functions that are not a datatype can be set +with Action::Set.

+
§

Relation

The relation is syntactic sugar for a named function which returns the Unit type. +Example:

+
(relation path (i64 i64))
+(relation edge (i64 i64))
+
+

Desugars to:

+
(function path (i64 i64) Unit :default ())
+(function edge (i64 i64) Unit :default ())
+

Fields

§span: Span
§constructor: GlobalSymbol
§

AddRuleset(GlobalSymbol)

Using the ruleset command, defines a new +ruleset that can be added to in Command::Rules. +Rulesets are used to group rules together +so that they can be run together in a Schedule.

+

Example: +Ruleset allows users to define a ruleset- a set of rules

+
(ruleset myrules)
+(rule ((edge x y))
+      ((path x y))
+      :ruleset myrules)
+(run myrules 2)
+
§

UnstableCombinedRuleset(GlobalSymbol, Vec<GlobalSymbol>)

Using the combined-ruleset command, construct another ruleset +which runs all the rules in the given rulesets. +This is useful for running multiple rulesets together. +The combined ruleset also inherits any rules added to the individual rulesets +after the combined ruleset is declared.

+

Example:

+
(ruleset myrules1)
+(rule ((edge x y))
+      ((path x y))
+     :ruleset myrules1)
+(ruleset myrules2)
+(rule ((path x y) (edge y z))
+      ((path x z))
+      :ruleset myrules2)
+(combined-ruleset myrules-combined myrules1 myrules2)
§

Rule

(rule <body:List<Fact>> <head:List<Action>>)
+
+

defines an egglog rule. +The rule matches a list of facts with respect to +the global database, and runs the list of actions +for each match. +The matches are done modulo equality, meaning +equal datatypes in the database are considered +equal. +Example:

+
(rule ((edge x y))
+      ((path x y)))
+(rule ((path x y) (edge y z))
+      ((path x z)))
+
§

Rewrite(GlobalSymbol, GenericRewrite<GlobalSymbol, GlobalSymbol>, bool)

rewrite is syntactic sugar for a specific form of rule +which simply unions the left and right hand sides.

+

Example:

+
(rewrite (Add a b)
+         (Add b a))
+
+

Desugars to:

+
(rule ((= lhs (Add a b)))
+      ((union lhs (Add b a))))
+
+

Additionally, additional facts can be specified +using a :when clause. +For example, the same rule can be run only +when a is zero:

+
(rewrite (Add a b)
+         (Add b a)
+         :when ((= a (Num 0)))
+
+

Add the :subsume flag to cause the left hand side to be subsumed after matching, which means it can +no longer be matched in a rule, but can still be checked against (See Change for more details.)

+
(rewrite (Mul a 2) (bitshift-left a 1) :subsume)
+
+

Desugars to:

+
(rule ((= lhs (Mul a 2)))
+      ((union lhs (bitshift-left a 1))
+       (subsume (Mul a 2))))
+
§

BiRewrite(GlobalSymbol, GenericRewrite<GlobalSymbol, GlobalSymbol>)

Similar to Command::Rewrite, but +generates two rules, one for each direction.

+

Example:

+
(bi-rewrite (Mul (Var x) (Num 0))
+            (Var x))
+
+

Becomes:

+
(rule ((= lhs (Mul (Var x) (Num 0))))
+      ((union lhs (Var x))))
+(rule ((= lhs (Var x)))
+      ((union lhs (Mul (Var x) (Num 0)))))
+
§

Action(GenericAction<GlobalSymbol, GlobalSymbol>)

Perform an Action on the global database +(see documentation for Action for more details). +Example:

+
(let xplusone (Add (Var "x") (Num 1)))
+
§

RunSchedule(GenericSchedule<GlobalSymbol, GlobalSymbol>)

Runs a Schedule, which specifies +rulesets and the number of times to run them.

+

Example:

+
(run-schedule
+    (saturate my-ruleset-1)
+    (run my-ruleset-2 4))
+
+

Runs my-ruleset-1 until saturation, +then runs my-ruleset-2 four times.

+

See Schedule for more details.

+
§

PrintOverallStatistics

Print runtime statistics about rules +and rulesets so far.

+
§

Simplify

§

QueryExtract

The query-extract command runs a query, +extracting the result for each match that it finds. +For a simpler extraction command, use Action::Extract instead.

+

Example:

+
(query-extract (Add a b))
+
+

Extracts every Add term in the database, once +for each class of equivalent a and b.

+

The resulting datatype is chosen from the egraph +as the smallest term by size (taking into account +the :cost annotations for each constructor). +This cost does not take into account common sub-expressions. +For example, the following term has cost 5:

+
(Add
+    (Num 1)
+    (Num 1))
+
+

Under the hood, this command is implemented with the EGraph::extract +function.

+
§

Check(Span, Vec<GenericFact<GlobalSymbol, GlobalSymbol>>)

The check command checks that the given facts +match at least once in the current database. +The list of facts is matched in the same way a Command::Rule is matched.

+

Example:

+
(check (= (+ 1 2) 3))
+(check (<= 0 3) (>= 3 0))
+(fail (check (= 1 2)))
+
+

prints

+
[INFO ] Checked.
+[INFO ] Checked.
+[ERROR] Check failed
+[INFO ] Command failed as expected.
+
§

PrintFunction(Span, GlobalSymbol, usize)

Print out rows a given function, extracting each of the elements of the function. +Example:

+
(print-function Add 20)
+
+

prints the first 20 rows of the Add function.

+
§

PrintSize(Span, Option<GlobalSymbol>)

Print out the number of rows in a function or all functions.

+
§

Input

Input a CSV file directly into a function.

+

Fields

§span: Span
§file: String
§

Output

Extract and output a set of expressions to a file.

+
§

Push(usize)

push the current egraph n times so that it is saved. +Later, the current database and rules can be restored using pop.

+
§

Pop(Span, usize)

pop the current egraph, restoring the previous one. +The argument specifies how many egraphs to pop.

+
§

Fail(Span, Box<GenericCommand<GlobalSymbol, GlobalSymbol>>)

Assert that a command fails with an error.

+
§

Include(Span, String)

Include another egglog file directly as text and run it.

+
\ No newline at end of file diff --git a/docs/egglog/ast/type.Expr.html b/docs/egglog/ast/type.Expr.html new file mode 100644 index 00000000..d2a0cf92 --- /dev/null +++ b/docs/egglog/ast/type.Expr.html @@ -0,0 +1,8 @@ +Expr in egglog::ast - Rust

Type Alias egglog::ast::Expr

source ·
pub type Expr = GenericExpr<Symbol, Symbol>;

Aliased Type§

enum Expr {
+    Lit(Span, Literal),
+    Var(Span, GlobalSymbol),
+    Call(Span, GlobalSymbol, Vec<GenericExpr<GlobalSymbol, GlobalSymbol>>),
+}

Variants§

Implementations§

source§

impl Expr

source

pub fn call_no_span( + op: impl Into<Symbol>, + children: impl IntoIterator<Item = Self> +) -> Self

source

pub fn lit_no_span(lit: impl Into<Literal>) -> Self

source

pub fn var_no_span(v: impl Into<Symbol>) -> Self

\ No newline at end of file diff --git a/docs/egglog/ast/type.Fact.html b/docs/egglog/ast/type.Fact.html new file mode 100644 index 00000000..d5dd9e7e --- /dev/null +++ b/docs/egglog/ast/type.Fact.html @@ -0,0 +1,5 @@ +Fact in egglog::ast - Rust

Type Alias egglog::ast::Fact

source ·
pub type Fact = GenericFact<Symbol, Symbol>;

Aliased Type§

enum Fact {
+    Eq(Span, Vec<GenericExpr<GlobalSymbol, GlobalSymbol>>),
+    Fact(GenericExpr<GlobalSymbol, GlobalSymbol>),
+}

Variants§

§

Eq(Span, Vec<GenericExpr<GlobalSymbol, GlobalSymbol>>)

Must be at least two things in an eq fact

+
§

Fact(GenericExpr<GlobalSymbol, GlobalSymbol>)

\ No newline at end of file diff --git a/docs/egglog/ast/type.FunctionDecl.html b/docs/egglog/ast/type.FunctionDecl.html new file mode 100644 index 00000000..6bad97ba --- /dev/null +++ b/docs/egglog/ast/type.FunctionDecl.html @@ -0,0 +1,13 @@ +FunctionDecl in egglog::ast - Rust

Type Alias egglog::ast::FunctionDecl

source ·
pub type FunctionDecl = GenericFunctionDecl<Symbol, Symbol>;

Aliased Type§

struct FunctionDecl {
+    pub name: GlobalSymbol,
+    pub schema: Schema,
+    pub default: Option<GenericExpr<GlobalSymbol, GlobalSymbol>>,
+    pub merge: Option<GenericExpr<GlobalSymbol, GlobalSymbol>>,
+    pub merge_action: GenericActions<GlobalSymbol, GlobalSymbol>,
+    pub cost: Option<usize>,
+    pub unextractable: bool,
+    pub ignore_viz: bool,
+    pub span: Span,
+}

Fields§

§name: GlobalSymbol§schema: Schema§default: Option<GenericExpr<GlobalSymbol, GlobalSymbol>>§merge: Option<GenericExpr<GlobalSymbol, GlobalSymbol>>§merge_action: GenericActions<GlobalSymbol, GlobalSymbol>§cost: Option<usize>§unextractable: bool§ignore_viz: bool

Globals are desugared to functions, with this flag set to true. +This is used by visualization to handle globals differently.

+
§span: Span

Implementations§

source§

impl FunctionDecl

source

pub fn relation(span: Span, name: Symbol, input: Vec<Symbol>) -> Self

\ No newline at end of file diff --git a/docs/egglog/ast/type.NCommand.html b/docs/egglog/ast/type.NCommand.html new file mode 100644 index 00000000..8bd9a339 --- /dev/null +++ b/docs/egglog/ast/type.NCommand.html @@ -0,0 +1,34 @@ +NCommand in egglog::ast - Rust

Type Alias egglog::ast::NCommand

source ·
pub type NCommand = GenericNCommand<Symbol, Symbol>;

Aliased Type§

enum NCommand {
+
Show 17 variants SetOption { + name: GlobalSymbol, + value: GenericExpr<GlobalSymbol, GlobalSymbol>, + }, + Sort(Span, GlobalSymbol, Option<(GlobalSymbol, Vec<GenericExpr<GlobalSymbol, GlobalSymbol>>)>), + Function(GenericFunctionDecl<GlobalSymbol, GlobalSymbol>), + AddRuleset(GlobalSymbol), + UnstableCombinedRuleset(GlobalSymbol, Vec<GlobalSymbol>), + NormRule { + name: GlobalSymbol, + ruleset: GlobalSymbol, + rule: GenericRule<GlobalSymbol, GlobalSymbol>, + }, + CoreAction(GenericAction<GlobalSymbol, GlobalSymbol>), + RunSchedule(GenericSchedule<GlobalSymbol, GlobalSymbol>), + PrintOverallStatistics, + Check(Span, Vec<GenericFact<GlobalSymbol, GlobalSymbol>>), + PrintTable(Span, GlobalSymbol, usize), + PrintSize(Span, Option<GlobalSymbol>), + Output { + span: Span, + file: String, + exprs: Vec<GenericExpr<GlobalSymbol, GlobalSymbol>>, + }, + Push(usize), + Pop(Span, usize), + Fail(Span, Box<GenericNCommand<GlobalSymbol, GlobalSymbol>>), + Input { + span: Span, + name: GlobalSymbol, + file: String, + }, +
}

Variants§

\ No newline at end of file diff --git a/docs/egglog/ast/type.Rewrite.html b/docs/egglog/ast/type.Rewrite.html new file mode 100644 index 00000000..89da3c51 --- /dev/null +++ b/docs/egglog/ast/type.Rewrite.html @@ -0,0 +1,6 @@ +Rewrite in egglog::ast - Rust

Type Alias egglog::ast::Rewrite

source ·
pub type Rewrite = GenericRewrite<Symbol, Symbol>;

Aliased Type§

struct Rewrite {
+    pub span: Span,
+    pub lhs: GenericExpr<GlobalSymbol, GlobalSymbol>,
+    pub rhs: GenericExpr<GlobalSymbol, GlobalSymbol>,
+    pub conditions: Vec<GenericFact<GlobalSymbol, GlobalSymbol>>,
+}

Fields§

§span: Span§lhs: GenericExpr<GlobalSymbol, GlobalSymbol>§rhs: GenericExpr<GlobalSymbol, GlobalSymbol>§conditions: Vec<GenericFact<GlobalSymbol, GlobalSymbol>>
\ No newline at end of file diff --git a/docs/egglog/ast/type.Rule.html b/docs/egglog/ast/type.Rule.html new file mode 100644 index 00000000..89ec0c8c --- /dev/null +++ b/docs/egglog/ast/type.Rule.html @@ -0,0 +1,5 @@ +Rule in egglog::ast - Rust

Type Alias egglog::ast::Rule

source ·
pub type Rule = GenericRule<Symbol, Symbol>;

Aliased Type§

struct Rule {
+    pub span: Span,
+    pub head: GenericActions<GlobalSymbol, GlobalSymbol>,
+    pub body: Vec<GenericFact<GlobalSymbol, GlobalSymbol>>,
+}

Fields§

§span: Span§head: GenericActions<GlobalSymbol, GlobalSymbol>§body: Vec<GenericFact<GlobalSymbol, GlobalSymbol>>
\ No newline at end of file diff --git a/docs/egglog/ast/type.RunConfig.html b/docs/egglog/ast/type.RunConfig.html new file mode 100644 index 00000000..bbb432b0 --- /dev/null +++ b/docs/egglog/ast/type.RunConfig.html @@ -0,0 +1,4 @@ +RunConfig in egglog::ast - Rust

Type Alias egglog::ast::RunConfig

source ·
pub type RunConfig = GenericRunConfig<Symbol, Symbol>;

Aliased Type§

struct RunConfig {
+    pub ruleset: GlobalSymbol,
+    pub until: Option<Vec<GenericFact<GlobalSymbol, GlobalSymbol>>>,
+}

Fields§

§ruleset: GlobalSymbol§until: Option<Vec<GenericFact<GlobalSymbol, GlobalSymbol>>>
\ No newline at end of file diff --git a/docs/egglog/ast/type.Schedule.html b/docs/egglog/ast/type.Schedule.html new file mode 100644 index 00000000..a033faf5 --- /dev/null +++ b/docs/egglog/ast/type.Schedule.html @@ -0,0 +1,6 @@ +Schedule in egglog::ast - Rust

Type Alias egglog::ast::Schedule

source ·
pub type Schedule = GenericSchedule<Symbol, Symbol>;

Aliased Type§

enum Schedule {
+    Saturate(Span, Box<GenericSchedule<GlobalSymbol, GlobalSymbol>>),
+    Repeat(Span, usize, Box<GenericSchedule<GlobalSymbol, GlobalSymbol>>),
+    Run(Span, GenericRunConfig<GlobalSymbol, GlobalSymbol>),
+    Sequence(Span, Vec<GenericSchedule<GlobalSymbol, GlobalSymbol>>),
+}

Variants§

\ No newline at end of file diff --git a/docs/egglog/ast/type.Subsume.html b/docs/egglog/ast/type.Subsume.html new file mode 100644 index 00000000..3adf0ffd --- /dev/null +++ b/docs/egglog/ast/type.Subsume.html @@ -0,0 +1 @@ +Subsume in egglog::ast - Rust

Type Alias egglog::ast::Subsume

source ·
pub type Subsume = bool;
\ No newline at end of file diff --git a/docs/egglog/constraint/enum.Constraint.html b/docs/egglog/constraint/enum.Constraint.html new file mode 100644 index 00000000..624f35bd --- /dev/null +++ b/docs/egglog/constraint/enum.Constraint.html @@ -0,0 +1,26 @@ +Constraint in egglog::constraint - Rust

Enum egglog::constraint::Constraint

source ·
pub enum Constraint<Var, Value> {
+    Eq(Var, Var),
+    Assign(Var, Value),
+    And(Vec<Constraint<Var, Value>>),
+    Xor(Vec<Constraint<Var, Value>>),
+    Impossible(ImpossibleConstraint),
+}

Variants§

§

Eq(Var, Var)

§

Assign(Var, Value)

§

And(Vec<Constraint<Var, Value>>)

§

Xor(Vec<Constraint<Var, Value>>)

§

Impossible(ImpossibleConstraint)

Trait Implementations§

source§

impl<Var: Debug, Value: Debug> Debug for Constraint<Var, Value>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Var, Value> Freeze for Constraint<Var, Value>
where + Var: Freeze, + Value: Freeze,

§

impl<Var, Value> !RefUnwindSafe for Constraint<Var, Value>

§

impl<Var, Value> Send for Constraint<Var, Value>
where + Var: Send, + Value: Send,

§

impl<Var, Value> Sync for Constraint<Var, Value>
where + Var: Sync, + Value: Sync,

§

impl<Var, Value> Unpin for Constraint<Var, Value>
where + Var: Unpin, + Value: Unpin,

§

impl<Var, Value> !UnwindSafe for Constraint<Var, Value>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/constraint/enum.ConstraintError.html b/docs/egglog/constraint/enum.ConstraintError.html new file mode 100644 index 00000000..c932f159 --- /dev/null +++ b/docs/egglog/constraint/enum.ConstraintError.html @@ -0,0 +1,25 @@ +ConstraintError in egglog::constraint - Rust

Enum egglog::constraint::ConstraintError

source ·
pub enum ConstraintError<Var, Value> {
+    InconsistentConstraint(Var, Value, Value),
+    UnconstrainedVar(Var),
+    NoConstraintSatisfied(Vec<ConstraintError<Var, Value>>),
+    ImpossibleCaseIdentified(ImpossibleConstraint),
+}

Variants§

§

InconsistentConstraint(Var, Value, Value)

§

UnconstrainedVar(Var)

§

NoConstraintSatisfied(Vec<ConstraintError<Var, Value>>)

§

ImpossibleCaseIdentified(ImpossibleConstraint)

Implementations§

source§

impl ConstraintError<GenericAtomTerm<Symbol>, ArcSort>

source

pub fn to_type_error(&self) -> TypeError

Auto Trait Implementations§

§

impl<Var, Value> Freeze for ConstraintError<Var, Value>
where + Var: Freeze, + Value: Freeze,

§

impl<Var, Value> !RefUnwindSafe for ConstraintError<Var, Value>

§

impl<Var, Value> Send for ConstraintError<Var, Value>
where + Var: Send, + Value: Send,

§

impl<Var, Value> Sync for ConstraintError<Var, Value>
where + Var: Sync, + Value: Sync,

§

impl<Var, Value> Unpin for ConstraintError<Var, Value>
where + Var: Unpin, + Value: Unpin,

§

impl<Var, Value> !UnwindSafe for ConstraintError<Var, Value>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/constraint/enum.ImpossibleConstraint.html b/docs/egglog/constraint/enum.ImpossibleConstraint.html new file mode 100644 index 00000000..f117d621 --- /dev/null +++ b/docs/egglog/constraint/enum.ImpossibleConstraint.html @@ -0,0 +1,25 @@ +ImpossibleConstraint in egglog::constraint - Rust

Enum egglog::constraint::ImpossibleConstraint

source ·
pub enum ImpossibleConstraint {
+    ArityMismatch {
+        atom: GenericAtom<Symbol, Symbol>,
+        expected: usize,
+        actual: usize,
+    },
+    FunctionMismatch {
+        expected_output: ArcSort,
+        expected_input: Vec<ArcSort>,
+        actual_output: ArcSort,
+        actual_input: Vec<ArcSort>,
+    },
+}

Variants§

§

ArityMismatch

Fields

§atom: GenericAtom<Symbol, Symbol>
§expected: usize
§actual: usize
§

FunctionMismatch

Fields

§expected_output: ArcSort
§expected_input: Vec<ArcSort>
§actual_output: ArcSort
§actual_input: Vec<ArcSort>

Trait Implementations§

source§

impl Clone for ImpossibleConstraint

source§

fn clone(&self) -> ImpossibleConstraint

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ImpossibleConstraint

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/constraint/index.html b/docs/egglog/constraint/index.html new file mode 100644 index 00000000..e5814dcb --- /dev/null +++ b/docs/egglog/constraint/index.html @@ -0,0 +1 @@ +egglog::constraint - Rust

Module egglog::constraint

source ·

Structs§

Enums§

Traits§

\ No newline at end of file diff --git a/docs/egglog/constraint/sidebar-items.js b/docs/egglog/constraint/sidebar-items.js new file mode 100644 index 00000000..b8b4f2d6 --- /dev/null +++ b/docs/egglog/constraint/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Constraint","ConstraintError","ImpossibleConstraint"],"struct":["AllEqualTypeConstraint","Problem","SimpleTypeConstraint"],"trait":["TypeConstraint"]}; \ No newline at end of file diff --git a/docs/egglog/constraint/struct.AllEqualTypeConstraint.html b/docs/egglog/constraint/struct.AllEqualTypeConstraint.html new file mode 100644 index 00000000..358e2e84 --- /dev/null +++ b/docs/egglog/constraint/struct.AllEqualTypeConstraint.html @@ -0,0 +1,23 @@ +AllEqualTypeConstraint in egglog::constraint - Rust

Struct egglog::constraint::AllEqualTypeConstraint

source ·
pub struct AllEqualTypeConstraint { /* private fields */ }
Expand description

This constraint requires all types to be equivalent to each other

+

Implementations§

source§

impl AllEqualTypeConstraint

source

pub fn new(name: Symbol, span: Span) -> AllEqualTypeConstraint

source

pub fn into_box(self) -> Box<dyn TypeConstraint>

source

pub fn with_all_arguments_sort(self, sort: ArcSort) -> Self

Requires all arguments to have the given sort. +If with_output_sort is not specified, this requirement +also applies to the output argument.

+
source

pub fn with_exact_length(self, exact_length: usize) -> Self

Requires the length of arguments to be exact_length. +Note this includes both input arguments and output argument.

+
source

pub fn with_output_sort(self, output_sort: ArcSort) -> Self

Requires the output argument to have the given sort.

+

Trait Implementations§

source§

impl TypeConstraint for AllEqualTypeConstraint

source§

fn get( + &self, + arguments: &[GenericAtomTerm<Symbol>], + _typeinfo: &TypeInfo +) -> Vec<Constraint<GenericAtomTerm<Symbol>, ArcSort>>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/constraint/struct.Problem.html b/docs/egglog/constraint/struct.Problem.html new file mode 100644 index 00000000..16dba227 --- /dev/null +++ b/docs/egglog/constraint/struct.Problem.html @@ -0,0 +1,26 @@ +Problem in egglog::constraint - Rust

Struct egglog::constraint::Problem

source ·
pub struct Problem<Var, Value> {
+    pub constraints: Vec<Constraint<Var, Value>>,
+    pub range: HashSet<Var, BuildHasherDefault<FxHasher>>,
+}

Fields§

§constraints: Vec<Constraint<Var, Value>>§range: HashSet<Var, BuildHasherDefault<FxHasher>>

Implementations§

source§

impl Problem<GenericAtomTerm<Symbol>, ArcSort>

source

pub fn add_actions( + &mut self, + actions: &GenericCoreActions<Symbol, Symbol>, + typeinfo: &TypeInfo, + symbol_gen: &mut SymbolGen +) -> Result<(), TypeError>

Trait Implementations§

source§

impl<Var: Debug, Value: Debug> Debug for Problem<Var, Value>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Problem<GenericAtomTerm<Symbol>, ArcSort>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<Var, Value> Freeze for Problem<Var, Value>

§

impl<Var, Value> !RefUnwindSafe for Problem<Var, Value>

§

impl<Var, Value> Send for Problem<Var, Value>
where + Var: Send, + Value: Send,

§

impl<Var, Value> Sync for Problem<Var, Value>
where + Var: Sync, + Value: Sync,

§

impl<Var, Value> Unpin for Problem<Var, Value>
where + Var: Unpin, + Value: Unpin,

§

impl<Var, Value> !UnwindSafe for Problem<Var, Value>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/constraint/struct.SimpleTypeConstraint.html b/docs/egglog/constraint/struct.SimpleTypeConstraint.html new file mode 100644 index 00000000..a5021bb6 --- /dev/null +++ b/docs/egglog/constraint/struct.SimpleTypeConstraint.html @@ -0,0 +1,21 @@ +SimpleTypeConstraint in egglog::constraint - Rust

Struct egglog::constraint::SimpleTypeConstraint

source ·
pub struct SimpleTypeConstraint { /* private fields */ }
Expand description

Construct a set of Assign constraints that fully constrain the type of arguments

+

Implementations§

source§

impl SimpleTypeConstraint

source

pub fn new( + name: Symbol, + sorts: Vec<ArcSort>, + span: Span +) -> SimpleTypeConstraint

source

pub fn into_box(self) -> Box<dyn TypeConstraint>

Trait Implementations§

source§

impl TypeConstraint for SimpleTypeConstraint

source§

fn get( + &self, + arguments: &[GenericAtomTerm<Symbol>], + _typeinfo: &TypeInfo +) -> Vec<Constraint<GenericAtomTerm<Symbol>, ArcSort>>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/constraint/trait.TypeConstraint.html b/docs/egglog/constraint/trait.TypeConstraint.html new file mode 100644 index 00000000..28ab70e0 --- /dev/null +++ b/docs/egglog/constraint/trait.TypeConstraint.html @@ -0,0 +1,12 @@ +TypeConstraint in egglog::constraint - Rust

Trait egglog::constraint::TypeConstraint

source ·
pub trait TypeConstraint {
+    // Required method
+    fn get(
+        &self,
+        arguments: &[GenericAtomTerm<Symbol>],
+        typeinfo: &TypeInfo
+    ) -> Vec<Constraint<GenericAtomTerm<Symbol>, ArcSort>>;
+}

Required Methods§

source

fn get( + &self, + arguments: &[GenericAtomTerm<Symbol>], + typeinfo: &TypeInfo +) -> Vec<Constraint<GenericAtomTerm<Symbol>, ArcSort>>

Implementors§

\ No newline at end of file diff --git a/docs/egglog/enum.Error.html b/docs/egglog/enum.Error.html new file mode 100644 index 00000000..354ee5f8 --- /dev/null +++ b/docs/egglog/enum.Error.html @@ -0,0 +1,27 @@ +Error in egglog - Rust

Enum egglog::Error

source ·
pub enum Error {
+
Show 13 variants ParseError(ParseError), + NotFoundError(NotFoundError), + TypeError(TypeError), + TypeErrors(Vec<TypeError>), + CheckError(Vec<Fact>, Span), + NoSuchRuleset(Symbol, Span), + CombinedRulesetError(Symbol, Span), + PrimitiveError(Primitive, Vec<Value>), + MergeError(Symbol, Value, Value), + Pop(Span), + ExpectFail(Span), + IoError(PathBuf, Error, Span), + SubsumeMergeError(Symbol), +
}

Variants§

§

ParseError(ParseError)

§

NotFoundError(NotFoundError)

§

TypeError(TypeError)

§

TypeErrors(Vec<TypeError>)

§

CheckError(Vec<Fact>, Span)

§

NoSuchRuleset(Symbol, Span)

§

CombinedRulesetError(Symbol, Span)

§

PrimitiveError(Primitive, Vec<Value>)

§

MergeError(Symbol, Value, Value)

§

Pop(Span)

§

ExpectFail(Span)

§

IoError(PathBuf, Error, Span)

§

SubsumeMergeError(Symbol)

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<NotFoundError> for Error

source§

fn from(source: NotFoundError) -> Self

Converts to this type from the input type.
source§

impl From<ParseError> for Error

source§

fn from(source: ParseError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl !Send for Error

§

impl !Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/enum.ExtractReport.html b/docs/egglog/enum.ExtractReport.html new file mode 100644 index 00000000..c67f4099 --- /dev/null +++ b/docs/egglog/enum.ExtractReport.html @@ -0,0 +1,24 @@ +ExtractReport in egglog - Rust

Enum egglog::ExtractReport

source ·
pub enum ExtractReport {
+    Best {
+        termdag: TermDag,
+        cost: usize,
+        term: Term,
+    },
+    Variants {
+        termdag: TermDag,
+        terms: Vec<Term>,
+    },
+}
Expand description

A report of the results of an extract action.

+

Variants§

§

Best

Fields

§termdag: TermDag
§cost: usize
§term: Term
§

Variants

Fields

§termdag: TermDag
§terms: Vec<Term>

Trait Implementations§

source§

impl Clone for ExtractReport

source§

fn clone(&self) -> ExtractReport

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExtractReport

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/enum.RunMode.html b/docs/egglog/enum.RunMode.html new file mode 100644 index 00000000..a938cc59 --- /dev/null +++ b/docs/egglog/enum.RunMode.html @@ -0,0 +1,23 @@ +RunMode in egglog - Rust

Enum egglog::RunMode

source ·
pub enum RunMode {
+    Normal,
+    ShowDesugaredEgglog,
+}

Variants§

§

Normal

§

ShowDesugaredEgglog

Trait Implementations§

source§

impl Clone for RunMode

source§

fn clone(&self) -> RunMode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RunMode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for RunMode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromStr for RunMode

§

type Err = String

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for RunMode

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for RunMode

source§

fn eq(&self, other: &RunMode) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for RunMode

source§

impl Eq for RunMode

source§

impl StructuralPartialEq for RunMode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/enum.SerializedNode.html b/docs/egglog/enum.SerializedNode.html new file mode 100644 index 00000000..6f59516b --- /dev/null +++ b/docs/egglog/enum.SerializedNode.html @@ -0,0 +1,32 @@ +SerializedNode in egglog - Rust

Enum egglog::SerializedNode

source ·
pub enum SerializedNode {
+    Function {
+        name: Symbol,
+        offset: usize,
+    },
+    Primitive(Value),
+    Dummy(Value),
+    Split(Box<SerializedNode>),
+}
Expand description

A node in the serialized egraph.

+

Variants§

§

Function

A user defined function call.

+

Fields

§name: Symbol

The name of the function.

+
§offset: usize

The offset of the index in the table. +This can be resolved to the output and input values with table.get_index(offset, true).

+
§

Primitive(Value)

A primitive value.

+
§

Dummy(Value)

A dummy node used to represent omitted nodes.

+
§

Split(Box<SerializedNode>)

A node that was split into multiple e-classes.

+

Implementations§

source§

impl SerializedNode

source

pub fn is_primitive(&self) -> bool

Returns true if the node is a primitive value.

+

Trait Implementations§

source§

impl Clone for SerializedNode

source§

fn clone(&self) -> SerializedNode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SerializedNode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for SerializedNode

source§

fn eq(&self, other: &SerializedNode) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for SerializedNode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/enum.Term.html b/docs/egglog/enum.Term.html new file mode 100644 index 00000000..5462b862 --- /dev/null +++ b/docs/egglog/enum.Term.html @@ -0,0 +1,26 @@ +Term in egglog - Rust

Enum egglog::Term

source ·
pub enum Term {
+    Lit(Literal),
+    Var(Symbol),
+    App(Symbol, Vec<TermId>),
+}
Expand description

Like Exprs but with sharing and deduplication.

+

Terms refer to their children indirectly via opaque TermIds (internally +these are just usizes) that map into an ambient TermDag.

+

Variants§

Trait Implementations§

source§

impl Clone for Term

source§

fn clone(&self) -> Term

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Term

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for Term

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Term

source§

fn eq(&self, other: &Term) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Term

source§

impl StructuralPartialEq for Term

Auto Trait Implementations§

§

impl Freeze for Term

§

impl RefUnwindSafe for Term

§

impl Send for Term

§

impl Sync for Term

§

impl Unpin for Term

§

impl UnwindSafe for Term

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/function/struct.Function.html b/docs/egglog/function/struct.Function.html new file mode 100644 index 00000000..9c42c3c3 --- /dev/null +++ b/docs/egglog/function/struct.Function.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../egglog/struct.Function.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/index.html b/docs/egglog/index.html new file mode 100644 index 00000000..b49f3e0a --- /dev/null +++ b/docs/egglog/index.html @@ -0,0 +1,16 @@ +egglog - Rust

Crate egglog

source ·
Expand description

§egglog

+

egglog is a language specialized for writing equality saturation +applications. It is the successor to the rust library egg. +egglog is faster and more general than egg.

+

§Documentation

+

Documentation for the egglog language can be found +here: Command

+

§Tutorial

+

Here is the video tutorial on what egglog is and how to use it. +We plan to have a text tutorial here soon, PRs welcome!

+

Modules§

Macros§

Structs§

Enums§

Traits§

Type Aliases§

\ No newline at end of file diff --git a/docs/egglog/macro.match_term_app!.html b/docs/egglog/macro.match_term_app!.html new file mode 100644 index 00000000..5065919c --- /dev/null +++ b/docs/egglog/macro.match_term_app!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.match_term_app.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/macro.match_term_app.html b/docs/egglog/macro.match_term_app.html new file mode 100644 index 00000000..52ae8f05 --- /dev/null +++ b/docs/egglog/macro.match_term_app.html @@ -0,0 +1,3 @@ +match_term_app in egglog - Rust

Macro egglog::match_term_app

source ·
macro_rules! match_term_app {
+    ($e:expr; $body:tt) => { ... };
+}
\ No newline at end of file diff --git a/docs/egglog/serialize/enum.SerializedNode.html b/docs/egglog/serialize/enum.SerializedNode.html new file mode 100644 index 00000000..bda24433 --- /dev/null +++ b/docs/egglog/serialize/enum.SerializedNode.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../egglog/enum.SerializedNode.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/serialize/struct.SerializeConfig.html b/docs/egglog/serialize/struct.SerializeConfig.html new file mode 100644 index 00000000..4fc2dacc --- /dev/null +++ b/docs/egglog/serialize/struct.SerializeConfig.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../egglog/struct.SerializeConfig.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/sidebar-items.js b/docs/egglog/sidebar-items.js new file mode 100644 index 00000000..1b1fa94c --- /dev/null +++ b/docs/egglog/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error","ExtractReport","RunMode","SerializedNode","Term"],"macro":["match_term_app"],"mod":["ast","constraint","sort","util"],"struct":["EGraph","Function","NotFoundError","Primitive","RunReport","SerializeConfig","SimplePrimitive","TermDag","TypeInfo","Value"],"trait":["PrimitiveLike"],"type":["ArcSort","Subst","TermId"]}; \ No newline at end of file diff --git a/docs/egglog/sort/bigint/struct.BigIntSort.html b/docs/egglog/sort/bigint/struct.BigIntSort.html new file mode 100644 index 00000000..ab70db6c --- /dev/null +++ b/docs/egglog/sort/bigint/struct.BigIntSort.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../egglog/sort/struct.BigIntSort.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/sort/bigrat/struct.BigRatSort.html b/docs/egglog/sort/bigrat/struct.BigRatSort.html new file mode 100644 index 00000000..9b7b829e --- /dev/null +++ b/docs/egglog/sort/bigrat/struct.BigRatSort.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../egglog/sort/struct.BigRatSort.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/sort/bool/struct.BoolSort.html b/docs/egglog/sort/bool/struct.BoolSort.html new file mode 100644 index 00000000..9ee52f89 --- /dev/null +++ b/docs/egglog/sort/bool/struct.BoolSort.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../egglog/sort/struct.BoolSort.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/sort/f64/struct.F64Sort.html b/docs/egglog/sort/f64/struct.F64Sort.html new file mode 100644 index 00000000..327cb05b --- /dev/null +++ b/docs/egglog/sort/f64/struct.F64Sort.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../egglog/sort/struct.F64Sort.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/sort/fn.literal_sort.html b/docs/egglog/sort/fn.literal_sort.html new file mode 100644 index 00000000..22ee1d35 --- /dev/null +++ b/docs/egglog/sort/fn.literal_sort.html @@ -0,0 +1 @@ +literal_sort in egglog::sort - Rust

Function egglog::sort::literal_sort

source ·
pub fn literal_sort(lit: &Literal) -> ArcSort
\ No newline at end of file diff --git a/docs/egglog/sort/fn/struct.FunctionSort.html b/docs/egglog/sort/fn/struct.FunctionSort.html new file mode 100644 index 00000000..9ba4eb4b --- /dev/null +++ b/docs/egglog/sort/fn/struct.FunctionSort.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../egglog/sort/struct.FunctionSort.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/sort/i64/struct.I64Sort.html b/docs/egglog/sort/i64/struct.I64Sort.html new file mode 100644 index 00000000..7b874b10 --- /dev/null +++ b/docs/egglog/sort/i64/struct.I64Sort.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../egglog/sort/struct.I64Sort.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/sort/index.html b/docs/egglog/sort/index.html new file mode 100644 index 00000000..b9eaeef0 --- /dev/null +++ b/docs/egglog/sort/index.html @@ -0,0 +1 @@ +egglog::sort - Rust

Module egglog::sort

source ·

Structs§

Traits§

Functions§

Type Aliases§

\ No newline at end of file diff --git a/docs/egglog/sort/map/struct.MapSort.html b/docs/egglog/sort/map/struct.MapSort.html new file mode 100644 index 00000000..0cb67a31 --- /dev/null +++ b/docs/egglog/sort/map/struct.MapSort.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../egglog/sort/struct.MapSort.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/sort/multiset/struct.MultiSetSort.html b/docs/egglog/sort/multiset/struct.MultiSetSort.html new file mode 100644 index 00000000..c2d82515 --- /dev/null +++ b/docs/egglog/sort/multiset/struct.MultiSetSort.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../egglog/sort/struct.MultiSetSort.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/sort/rational/struct.RationalSort.html b/docs/egglog/sort/rational/struct.RationalSort.html new file mode 100644 index 00000000..a990397a --- /dev/null +++ b/docs/egglog/sort/rational/struct.RationalSort.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../egglog/sort/struct.RationalSort.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/sort/set/struct.SetSort.html b/docs/egglog/sort/set/struct.SetSort.html new file mode 100644 index 00000000..4ca1dc95 --- /dev/null +++ b/docs/egglog/sort/set/struct.SetSort.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../egglog/sort/struct.SetSort.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/sort/sidebar-items.js b/docs/egglog/sort/sidebar-items.js new file mode 100644 index 00000000..df5130e4 --- /dev/null +++ b/docs/egglog/sort/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["literal_sort"],"struct":["BigIntSort","BigRatSort","BoolSort","EqSort","F64Sort","FunctionSort","I64Sort","MapSort","MultiSetSort","NotEqualPrimitive","RationalSort","SetSort","StringSort","UnitSort","VecSort"],"trait":["FromSort","IntoSort","Presort","Sort"],"type":["PreSort"]}; \ No newline at end of file diff --git a/docs/egglog/sort/string/struct.StringSort.html b/docs/egglog/sort/string/struct.StringSort.html new file mode 100644 index 00000000..f5c9005c --- /dev/null +++ b/docs/egglog/sort/string/struct.StringSort.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../egglog/sort/struct.StringSort.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/sort/struct.BigIntSort.html b/docs/egglog/sort/struct.BigIntSort.html new file mode 100644 index 00000000..4252ed42 --- /dev/null +++ b/docs/egglog/sort/struct.BigIntSort.html @@ -0,0 +1,25 @@ +BigIntSort in egglog::sort - Rust

Struct egglog::sort::BigIntSort

source ·
pub struct BigIntSort;

Trait Implementations§

source§

impl Debug for BigIntSort

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Sort for BigIntSort

source§

fn name(&self) -> Symbol

source§

fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>

source§

fn register_primitives(self: Arc<Self>, eg: &mut TypeInfo)

source§

fn make_expr(&self, _egraph: &EGraph, value: Value) -> (usize, Expr)

Extracting an expression (with smallest cost) out of a primitive value
source§

fn is_eq_sort(&self) -> bool

source§

fn is_container_sort(&self) -> bool

source§

fn is_eq_container_sort(&self) -> bool

source§

fn foreach_tracked_values<'a>( + &'a self, + value: &'a Value, + f: Box<dyn FnMut(ArcSort, Value) + 'a> +)

source§

fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool

source§

fn serialized_name(&self, _value: &Value) -> Symbol

Return the serialized name of the sort Read more
source§

fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)>

Return the inner values and sorts. +Only eq_container_sort need to implement this method,
source§

fn extract_expr( + &self, + egraph: &EGraph, + value: Value, + _extractor: &Extractor<'_>, + _termdag: &mut TermDag +) -> Option<(usize, Expr)>

For values like EqSort containers, to make/extract an expression from it +requires an extractor. Moreover, the extraction may be unsuccessful if +the extractor is not fully initialized. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/sort/struct.BigRatSort.html b/docs/egglog/sort/struct.BigRatSort.html new file mode 100644 index 00000000..cec21103 --- /dev/null +++ b/docs/egglog/sort/struct.BigRatSort.html @@ -0,0 +1,25 @@ +BigRatSort in egglog::sort - Rust

Struct egglog::sort::BigRatSort

source ·
pub struct BigRatSort;

Trait Implementations§

source§

impl Debug for BigRatSort

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Sort for BigRatSort

source§

fn name(&self) -> Symbol

source§

fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>

source§

fn register_primitives(self: Arc<Self>, eg: &mut TypeInfo)

source§

fn make_expr(&self, _egraph: &EGraph, value: Value) -> (usize, Expr)

Extracting an expression (with smallest cost) out of a primitive value
source§

fn is_eq_sort(&self) -> bool

source§

fn is_container_sort(&self) -> bool

source§

fn is_eq_container_sort(&self) -> bool

source§

fn foreach_tracked_values<'a>( + &'a self, + value: &'a Value, + f: Box<dyn FnMut(ArcSort, Value) + 'a> +)

source§

fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool

source§

fn serialized_name(&self, _value: &Value) -> Symbol

Return the serialized name of the sort Read more
source§

fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)>

Return the inner values and sorts. +Only eq_container_sort need to implement this method,
source§

fn extract_expr( + &self, + egraph: &EGraph, + value: Value, + _extractor: &Extractor<'_>, + _termdag: &mut TermDag +) -> Option<(usize, Expr)>

For values like EqSort containers, to make/extract an expression from it +requires an extractor. Moreover, the extraction may be unsuccessful if +the extractor is not fully initialized. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/sort/struct.BoolSort.html b/docs/egglog/sort/struct.BoolSort.html new file mode 100644 index 00000000..62f896d6 --- /dev/null +++ b/docs/egglog/sort/struct.BoolSort.html @@ -0,0 +1,25 @@ +BoolSort in egglog::sort - Rust

Struct egglog::sort::BoolSort

source ·
pub struct BoolSort;

Trait Implementations§

source§

impl Debug for BoolSort

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Sort for BoolSort

source§

fn name(&self) -> Symbol

source§

fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>

source§

fn register_primitives(self: Arc<Self>, eg: &mut TypeInfo)

source§

fn make_expr(&self, _egraph: &EGraph, value: Value) -> (usize, Expr)

Extracting an expression (with smallest cost) out of a primitive value
source§

fn is_eq_sort(&self) -> bool

source§

fn is_container_sort(&self) -> bool

source§

fn is_eq_container_sort(&self) -> bool

source§

fn foreach_tracked_values<'a>( + &'a self, + value: &'a Value, + f: Box<dyn FnMut(ArcSort, Value) + 'a> +)

source§

fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool

source§

fn serialized_name(&self, _value: &Value) -> Symbol

Return the serialized name of the sort Read more
source§

fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)>

Return the inner values and sorts. +Only eq_container_sort need to implement this method,
source§

fn extract_expr( + &self, + egraph: &EGraph, + value: Value, + _extractor: &Extractor<'_>, + _termdag: &mut TermDag +) -> Option<(usize, Expr)>

For values like EqSort containers, to make/extract an expression from it +requires an extractor. Moreover, the extraction may be unsuccessful if +the extractor is not fully initialized. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/sort/struct.EqSort.html b/docs/egglog/sort/struct.EqSort.html new file mode 100644 index 00000000..ed247d16 --- /dev/null +++ b/docs/egglog/sort/struct.EqSort.html @@ -0,0 +1,27 @@ +EqSort in egglog::sort - Rust

Struct egglog::sort::EqSort

source ·
pub struct EqSort {
+    pub name: Symbol,
+}

Fields§

§name: Symbol

Trait Implementations§

source§

impl Debug for EqSort

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Sort for EqSort

source§

fn name(&self) -> Symbol

source§

fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>

source§

fn is_eq_sort(&self) -> bool

source§

fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool

source§

fn make_expr(&self, _egraph: &EGraph, _value: Value) -> (usize, Expr)

Extracting an expression (with smallest cost) out of a primitive value
source§

fn is_container_sort(&self) -> bool

source§

fn is_eq_container_sort(&self) -> bool

source§

fn foreach_tracked_values<'a>( + &'a self, + value: &'a Value, + f: Box<dyn FnMut(ArcSort, Value) + 'a> +)

source§

fn serialized_name(&self, _value: &Value) -> Symbol

Return the serialized name of the sort Read more
source§

fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)>

Return the inner values and sorts. +Only eq_container_sort need to implement this method,
source§

fn register_primitives(self: Arc<Self>, info: &mut TypeInfo)

source§

fn extract_expr( + &self, + egraph: &EGraph, + value: Value, + _extractor: &Extractor<'_>, + _termdag: &mut TermDag +) -> Option<(usize, Expr)>

For values like EqSort containers, to make/extract an expression from it +requires an extractor. Moreover, the extraction may be unsuccessful if +the extractor is not fully initialized. Read more

Auto Trait Implementations§

§

impl Freeze for EqSort

§

impl RefUnwindSafe for EqSort

§

impl Send for EqSort

§

impl Sync for EqSort

§

impl Unpin for EqSort

§

impl UnwindSafe for EqSort

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/sort/struct.F64Sort.html b/docs/egglog/sort/struct.F64Sort.html new file mode 100644 index 00000000..d69e3965 --- /dev/null +++ b/docs/egglog/sort/struct.F64Sort.html @@ -0,0 +1,25 @@ +F64Sort in egglog::sort - Rust

Struct egglog::sort::F64Sort

source ·
pub struct F64Sort;

Trait Implementations§

source§

impl Debug for F64Sort

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Sort for F64Sort

source§

fn name(&self) -> Symbol

source§

fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>

source§

fn register_primitives(self: Arc<Self>, eg: &mut TypeInfo)

source§

fn make_expr(&self, _egraph: &EGraph, value: Value) -> (usize, Expr)

Extracting an expression (with smallest cost) out of a primitive value
source§

fn is_eq_sort(&self) -> bool

source§

fn is_container_sort(&self) -> bool

source§

fn is_eq_container_sort(&self) -> bool

source§

fn foreach_tracked_values<'a>( + &'a self, + value: &'a Value, + f: Box<dyn FnMut(ArcSort, Value) + 'a> +)

source§

fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool

source§

fn serialized_name(&self, _value: &Value) -> Symbol

Return the serialized name of the sort Read more
source§

fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)>

Return the inner values and sorts. +Only eq_container_sort need to implement this method,
source§

fn extract_expr( + &self, + egraph: &EGraph, + value: Value, + _extractor: &Extractor<'_>, + _termdag: &mut TermDag +) -> Option<(usize, Expr)>

For values like EqSort containers, to make/extract an expression from it +requires an extractor. Moreover, the extraction may be unsuccessful if +the extractor is not fully initialized. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/sort/struct.FunctionSort.html b/docs/egglog/sort/struct.FunctionSort.html new file mode 100644 index 00000000..27009545 --- /dev/null +++ b/docs/egglog/sort/struct.FunctionSort.html @@ -0,0 +1,40 @@ +FunctionSort in egglog::sort - Rust

Struct egglog::sort::FunctionSort

source ·
pub struct FunctionSort {
+    pub inputs: Vec<ArcSort>,
+    pub output: ArcSort,
+    /* private fields */
+}

Fields§

§inputs: Vec<ArcSort>§output: ArcSort

Implementations§

source§

impl FunctionSort

source

pub fn apply( + &self, + fn_value: &Value, + arg_values: &[Value], + egraph: &mut EGraph +) -> Value

Apply the function to the values

+

Public so that other primitive sorts (external or internal) can use this to apply functions

+

Trait Implementations§

source§

impl Debug for FunctionSort

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Presort for FunctionSort

source§

fn presort_name() -> Symbol

source§

fn reserved_primitives() -> Vec<Symbol>

source§

fn make_sort( + typeinfo: &mut TypeInfo, + name: Symbol, + args: &[Expr] +) -> Result<ArcSort, TypeError>

source§

impl Sort for FunctionSort

source§

fn name(&self) -> Symbol

source§

fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>

source§

fn is_container_sort(&self) -> bool

source§

fn is_eq_container_sort(&self) -> bool

source§

fn serialized_name(&self, value: &Value) -> Symbol

Return the serialized name of the sort Read more
source§

fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)>

Return the inner values and sorts. +Only eq_container_sort need to implement this method,
source§

fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool

source§

fn register_primitives(self: Arc<Self>, typeinfo: &mut TypeInfo)

source§

fn make_expr(&self, egraph: &EGraph, value: Value) -> (usize, Expr)

Extracting an expression (with smallest cost) out of a primitive value
source§

fn extract_expr( + &self, + _egraph: &EGraph, + value: Value, + extractor: &Extractor<'_>, + termdag: &mut TermDag +) -> Option<(usize, Expr)>

For values like EqSort containers, to make/extract an expression from it +requires an extractor. Moreover, the extraction may be unsuccessful if +the extractor is not fully initialized. Read more
source§

fn is_eq_sort(&self) -> bool

source§

fn foreach_tracked_values<'a>( + &'a self, + value: &'a Value, + f: Box<dyn FnMut(ArcSort, Value) + 'a> +)

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/sort/struct.I64Sort.html b/docs/egglog/sort/struct.I64Sort.html new file mode 100644 index 00000000..083d638e --- /dev/null +++ b/docs/egglog/sort/struct.I64Sort.html @@ -0,0 +1,25 @@ +I64Sort in egglog::sort - Rust

Struct egglog::sort::I64Sort

source ·
pub struct I64Sort;

Trait Implementations§

source§

impl Debug for I64Sort

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Sort for I64Sort

source§

fn name(&self) -> Symbol

source§

fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>

source§

fn register_primitives(self: Arc<Self>, typeinfo: &mut TypeInfo)

source§

fn make_expr(&self, _egraph: &EGraph, value: Value) -> (usize, Expr)

Extracting an expression (with smallest cost) out of a primitive value
source§

fn is_eq_sort(&self) -> bool

source§

fn is_container_sort(&self) -> bool

source§

fn is_eq_container_sort(&self) -> bool

source§

fn foreach_tracked_values<'a>( + &'a self, + value: &'a Value, + f: Box<dyn FnMut(ArcSort, Value) + 'a> +)

source§

fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool

source§

fn serialized_name(&self, _value: &Value) -> Symbol

Return the serialized name of the sort Read more
source§

fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)>

Return the inner values and sorts. +Only eq_container_sort need to implement this method,
source§

fn extract_expr( + &self, + egraph: &EGraph, + value: Value, + _extractor: &Extractor<'_>, + _termdag: &mut TermDag +) -> Option<(usize, Expr)>

For values like EqSort containers, to make/extract an expression from it +requires an extractor. Moreover, the extraction may be unsuccessful if +the extractor is not fully initialized. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/sort/struct.MapSort.html b/docs/egglog/sort/struct.MapSort.html new file mode 100644 index 00000000..2fd031df --- /dev/null +++ b/docs/egglog/sort/struct.MapSort.html @@ -0,0 +1,29 @@ +MapSort in egglog::sort - Rust

Struct egglog::sort::MapSort

source ·
pub struct MapSort { /* private fields */ }

Trait Implementations§

source§

impl Debug for MapSort

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Presort for MapSort

source§

fn presort_name() -> Symbol

source§

fn reserved_primitives() -> Vec<Symbol>

source§

fn make_sort( + typeinfo: &mut TypeInfo, + name: Symbol, + args: &[Expr] +) -> Result<ArcSort, TypeError>

source§

impl Sort for MapSort

source§

fn name(&self) -> Symbol

source§

fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>

source§

fn is_container_sort(&self) -> bool

source§

fn is_eq_container_sort(&self) -> bool

source§

fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)>

Return the inner values and sorts. +Only eq_container_sort need to implement this method,
source§

fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool

source§

fn register_primitives(self: Arc<Self>, typeinfo: &mut TypeInfo)

source§

fn make_expr(&self, egraph: &EGraph, value: Value) -> (usize, Expr)

Extracting an expression (with smallest cost) out of a primitive value
source§

fn extract_expr( + &self, + _egraph: &EGraph, + value: Value, + extractor: &Extractor<'_>, + termdag: &mut TermDag +) -> Option<(usize, Expr)>

For values like EqSort containers, to make/extract an expression from it +requires an extractor. Moreover, the extraction may be unsuccessful if +the extractor is not fully initialized. Read more
source§

fn is_eq_sort(&self) -> bool

source§

fn foreach_tracked_values<'a>( + &'a self, + value: &'a Value, + f: Box<dyn FnMut(ArcSort, Value) + 'a> +)

source§

fn serialized_name(&self, _value: &Value) -> Symbol

Return the serialized name of the sort Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/sort/struct.MultiSetSort.html b/docs/egglog/sort/struct.MultiSetSort.html new file mode 100644 index 00000000..fd376d51 --- /dev/null +++ b/docs/egglog/sort/struct.MultiSetSort.html @@ -0,0 +1,29 @@ +MultiSetSort in egglog::sort - Rust

Struct egglog::sort::MultiSetSort

source ·
pub struct MultiSetSort { /* private fields */ }

Implementations§

Trait Implementations§

source§

impl Debug for MultiSetSort

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Presort for MultiSetSort

source§

fn presort_name() -> Symbol

source§

fn reserved_primitives() -> Vec<Symbol>

source§

fn make_sort( + typeinfo: &mut TypeInfo, + name: Symbol, + args: &[Expr] +) -> Result<ArcSort, TypeError>

source§

impl Sort for MultiSetSort

source§

fn name(&self) -> Symbol

source§

fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>

source§

fn is_container_sort(&self) -> bool

source§

fn is_eq_container_sort(&self) -> bool

source§

fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)>

Return the inner values and sorts. +Only eq_container_sort need to implement this method,
source§

fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool

source§

fn register_primitives(self: Arc<Self>, typeinfo: &mut TypeInfo)

source§

fn make_expr(&self, egraph: &EGraph, value: Value) -> (usize, Expr)

Extracting an expression (with smallest cost) out of a primitive value
source§

fn extract_expr( + &self, + _egraph: &EGraph, + value: Value, + extractor: &Extractor<'_>, + termdag: &mut TermDag +) -> Option<(usize, Expr)>

For values like EqSort containers, to make/extract an expression from it +requires an extractor. Moreover, the extraction may be unsuccessful if +the extractor is not fully initialized. Read more
source§

fn serialized_name(&self, _value: &Value) -> Symbol

Return the serialized name of the sort Read more
source§

fn is_eq_sort(&self) -> bool

source§

fn foreach_tracked_values<'a>( + &'a self, + value: &'a Value, + f: Box<dyn FnMut(ArcSort, Value) + 'a> +)

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/sort/struct.NotEqualPrimitive.html b/docs/egglog/sort/struct.NotEqualPrimitive.html new file mode 100644 index 00000000..d2c48e24 --- /dev/null +++ b/docs/egglog/sort/struct.NotEqualPrimitive.html @@ -0,0 +1,18 @@ +NotEqualPrimitive in egglog::sort - Rust

Struct egglog::sort::NotEqualPrimitive

source ·
pub struct NotEqualPrimitive { /* private fields */ }

Trait Implementations§

source§

impl PrimitiveLike for NotEqualPrimitive

source§

fn name(&self) -> Symbol

source§

fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint>

Constructs a type constraint for the primitive that uses the span information +for error localization.
source§

fn apply( + &self, + values: &[Value], + _sorts: (&[ArcSort], &ArcSort), + _egraph: Option<&mut EGraph> +) -> Option<Value>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/sort/struct.RationalSort.html b/docs/egglog/sort/struct.RationalSort.html new file mode 100644 index 00000000..54d655bb --- /dev/null +++ b/docs/egglog/sort/struct.RationalSort.html @@ -0,0 +1,25 @@ +RationalSort in egglog::sort - Rust

Struct egglog::sort::RationalSort

source ·
pub struct RationalSort;

Trait Implementations§

source§

impl Debug for RationalSort

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Sort for RationalSort

source§

fn name(&self) -> Symbol

source§

fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>

source§

fn register_primitives(self: Arc<Self>, eg: &mut TypeInfo)

source§

fn make_expr(&self, _egraph: &EGraph, value: Value) -> (usize, Expr)

Extracting an expression (with smallest cost) out of a primitive value
source§

fn is_eq_sort(&self) -> bool

source§

fn is_container_sort(&self) -> bool

source§

fn is_eq_container_sort(&self) -> bool

source§

fn foreach_tracked_values<'a>( + &'a self, + value: &'a Value, + f: Box<dyn FnMut(ArcSort, Value) + 'a> +)

source§

fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool

source§

fn serialized_name(&self, _value: &Value) -> Symbol

Return the serialized name of the sort Read more
source§

fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)>

Return the inner values and sorts. +Only eq_container_sort need to implement this method,
source§

fn extract_expr( + &self, + egraph: &EGraph, + value: Value, + _extractor: &Extractor<'_>, + _termdag: &mut TermDag +) -> Option<(usize, Expr)>

For values like EqSort containers, to make/extract an expression from it +requires an extractor. Moreover, the extraction may be unsuccessful if +the extractor is not fully initialized. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/sort/struct.SetSort.html b/docs/egglog/sort/struct.SetSort.html new file mode 100644 index 00000000..7c0d187c --- /dev/null +++ b/docs/egglog/sort/struct.SetSort.html @@ -0,0 +1,29 @@ +SetSort in egglog::sort - Rust

Struct egglog::sort::SetSort

source ·
pub struct SetSort { /* private fields */ }

Implementations§

source§

impl SetSort

source

pub fn element(&self) -> ArcSort

source

pub fn element_name(&self) -> Symbol

Trait Implementations§

source§

impl Debug for SetSort

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Presort for SetSort

source§

fn presort_name() -> Symbol

source§

fn reserved_primitives() -> Vec<Symbol>

source§

fn make_sort( + typeinfo: &mut TypeInfo, + name: Symbol, + args: &[Expr] +) -> Result<ArcSort, TypeError>

source§

impl Sort for SetSort

source§

fn name(&self) -> Symbol

source§

fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>

source§

fn is_container_sort(&self) -> bool

source§

fn is_eq_container_sort(&self) -> bool

source§

fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)>

Return the inner values and sorts. +Only eq_container_sort need to implement this method,
source§

fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool

source§

fn register_primitives(self: Arc<Self>, typeinfo: &mut TypeInfo)

source§

fn make_expr(&self, egraph: &EGraph, value: Value) -> (usize, Expr)

Extracting an expression (with smallest cost) out of a primitive value
source§

fn extract_expr( + &self, + _egraph: &EGraph, + value: Value, + extractor: &Extractor<'_>, + termdag: &mut TermDag +) -> Option<(usize, Expr)>

For values like EqSort containers, to make/extract an expression from it +requires an extractor. Moreover, the extraction may be unsuccessful if +the extractor is not fully initialized. Read more
source§

fn serialized_name(&self, _value: &Value) -> Symbol

Return the serialized name of the sort Read more
source§

fn is_eq_sort(&self) -> bool

source§

fn foreach_tracked_values<'a>( + &'a self, + value: &'a Value, + f: Box<dyn FnMut(ArcSort, Value) + 'a> +)

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/sort/struct.StringSort.html b/docs/egglog/sort/struct.StringSort.html new file mode 100644 index 00000000..96d36eef --- /dev/null +++ b/docs/egglog/sort/struct.StringSort.html @@ -0,0 +1,25 @@ +StringSort in egglog::sort - Rust

Struct egglog::sort::StringSort

source ·
pub struct StringSort;

Trait Implementations§

source§

impl Debug for StringSort

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Sort for StringSort

source§

fn name(&self) -> Symbol

source§

fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>

source§

fn make_expr(&self, _egraph: &EGraph, value: Value) -> (usize, Expr)

Extracting an expression (with smallest cost) out of a primitive value
source§

fn register_primitives(self: Arc<Self>, typeinfo: &mut TypeInfo)

source§

fn is_eq_sort(&self) -> bool

source§

fn is_container_sort(&self) -> bool

source§

fn is_eq_container_sort(&self) -> bool

source§

fn foreach_tracked_values<'a>( + &'a self, + value: &'a Value, + f: Box<dyn FnMut(ArcSort, Value) + 'a> +)

source§

fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool

source§

fn serialized_name(&self, _value: &Value) -> Symbol

Return the serialized name of the sort Read more
source§

fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)>

Return the inner values and sorts. +Only eq_container_sort need to implement this method,
source§

fn extract_expr( + &self, + egraph: &EGraph, + value: Value, + _extractor: &Extractor<'_>, + _termdag: &mut TermDag +) -> Option<(usize, Expr)>

For values like EqSort containers, to make/extract an expression from it +requires an extractor. Moreover, the extraction may be unsuccessful if +the extractor is not fully initialized. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/sort/struct.UnitSort.html b/docs/egglog/sort/struct.UnitSort.html new file mode 100644 index 00000000..f5c86648 --- /dev/null +++ b/docs/egglog/sort/struct.UnitSort.html @@ -0,0 +1,25 @@ +UnitSort in egglog::sort - Rust

Struct egglog::sort::UnitSort

source ·
pub struct UnitSort;

Trait Implementations§

source§

impl Debug for UnitSort

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Sort for UnitSort

source§

fn name(&self) -> Symbol

source§

fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>

source§

fn register_primitives(self: Arc<Self>, type_info: &mut TypeInfo)

source§

fn make_expr(&self, _egraph: &EGraph, value: Value) -> (usize, Expr)

Extracting an expression (with smallest cost) out of a primitive value
source§

fn is_eq_sort(&self) -> bool

source§

fn is_container_sort(&self) -> bool

source§

fn is_eq_container_sort(&self) -> bool

source§

fn foreach_tracked_values<'a>( + &'a self, + value: &'a Value, + f: Box<dyn FnMut(ArcSort, Value) + 'a> +)

source§

fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool

source§

fn serialized_name(&self, _value: &Value) -> Symbol

Return the serialized name of the sort Read more
source§

fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)>

Return the inner values and sorts. +Only eq_container_sort need to implement this method,
source§

fn extract_expr( + &self, + egraph: &EGraph, + value: Value, + _extractor: &Extractor<'_>, + _termdag: &mut TermDag +) -> Option<(usize, Expr)>

For values like EqSort containers, to make/extract an expression from it +requires an extractor. Moreover, the extraction may be unsuccessful if +the extractor is not fully initialized. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/sort/struct.VecSort.html b/docs/egglog/sort/struct.VecSort.html new file mode 100644 index 00000000..a24da0cd --- /dev/null +++ b/docs/egglog/sort/struct.VecSort.html @@ -0,0 +1,29 @@ +VecSort in egglog::sort - Rust

Struct egglog::sort::VecSort

source ·
pub struct VecSort { /* private fields */ }

Implementations§

source§

impl VecSort

source

pub fn element(&self) -> ArcSort

source

pub fn element_name(&self) -> Symbol

Trait Implementations§

source§

impl Debug for VecSort

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Presort for VecSort

source§

fn presort_name() -> Symbol

source§

fn reserved_primitives() -> Vec<Symbol>

source§

fn make_sort( + typeinfo: &mut TypeInfo, + name: Symbol, + args: &[Expr] +) -> Result<ArcSort, TypeError>

source§

impl Sort for VecSort

source§

fn name(&self) -> Symbol

source§

fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>

source§

fn is_container_sort(&self) -> bool

source§

fn is_eq_container_sort(&self) -> bool

source§

fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)>

Return the inner values and sorts. +Only eq_container_sort need to implement this method,
source§

fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool

source§

fn register_primitives(self: Arc<Self>, typeinfo: &mut TypeInfo)

source§

fn make_expr(&self, egraph: &EGraph, value: Value) -> (usize, Expr)

Extracting an expression (with smallest cost) out of a primitive value
source§

fn extract_expr( + &self, + _egraph: &EGraph, + value: Value, + extractor: &Extractor<'_>, + termdag: &mut TermDag +) -> Option<(usize, Expr)>

For values like EqSort containers, to make/extract an expression from it +requires an extractor. Moreover, the extraction may be unsuccessful if +the extractor is not fully initialized. Read more
source§

fn serialized_name(&self, _value: &Value) -> Symbol

Return the serialized name of the sort Read more
source§

fn is_eq_sort(&self) -> bool

source§

fn foreach_tracked_values<'a>( + &'a self, + value: &'a Value, + f: Box<dyn FnMut(ArcSort, Value) + 'a> +)

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/sort/trait.FromSort.html b/docs/egglog/sort/trait.FromSort.html new file mode 100644 index 00000000..822602c0 --- /dev/null +++ b/docs/egglog/sort/trait.FromSort.html @@ -0,0 +1,6 @@ +FromSort in egglog::sort - Rust

Trait egglog::sort::FromSort

source ·
pub trait FromSort: Sized {
+    type Sort: Sort;
+
+    // Required method
+    fn load(sort: &Self::Sort, value: &Value) -> Self;
+}

Required Associated Types§

Required Methods§

source

fn load(sort: &Self::Sort, value: &Value) -> Self

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FromSort for bool

§

type Sort = BoolSort

source§

fn load(_sort: &Self::Sort, value: &Value) -> Self

source§

impl FromSort for f64

§

type Sort = F64Sort

source§

fn load(_sort: &Self::Sort, value: &Value) -> Self

source§

impl FromSort for i64

§

type Sort = I64Sort

source§

fn load(_sort: &Self::Sort, value: &Value) -> Self

source§

impl FromSort for BTreeMap<Value, Value>

§

type Sort = MapSort

source§

fn load(sort: &Self::Sort, value: &Value) -> Self

source§

impl FromSort for BTreeSet<Value>

§

type Sort = SetSort

source§

fn load(sort: &Self::Sort, value: &Value) -> Self

source§

impl FromSort for Vec<Value>

§

type Sort = VecSort

source§

fn load(sort: &Self::Sort, value: &Value) -> Self

source§

impl FromSort for BigInt

§

type Sort = BigIntSort

source§

fn load(_sort: &Self::Sort, value: &Value) -> Self

source§

impl FromSort for BigRational

§

type Sort = BigRatSort

source§

fn load(_sort: &Self::Sort, value: &Value) -> Self

source§

impl FromSort for Rational64

§

type Sort = RationalSort

source§

fn load(_sort: &Self::Sort, value: &Value) -> Self

Implementors§

\ No newline at end of file diff --git a/docs/egglog/sort/trait.IntoSort.html b/docs/egglog/sort/trait.IntoSort.html new file mode 100644 index 00000000..4e811989 --- /dev/null +++ b/docs/egglog/sort/trait.IntoSort.html @@ -0,0 +1,6 @@ +IntoSort in egglog::sort - Rust

Trait egglog::sort::IntoSort

source ·
pub trait IntoSort: Sized {
+    type Sort: Sort;
+
+    // Required method
+    fn store(self, sort: &Self::Sort) -> Option<Value>;
+}

Required Associated Types§

Required Methods§

source

fn store(self, sort: &Self::Sort) -> Option<Value>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl IntoSort for bool

§

type Sort = BoolSort

source§

fn store(self, _sort: &Self::Sort) -> Option<Value>

source§

impl IntoSort for f64

§

type Sort = F64Sort

source§

fn store(self, _sort: &Self::Sort) -> Option<Value>

source§

impl IntoSort for i64

§

type Sort = I64Sort

source§

fn store(self, _sort: &Self::Sort) -> Option<Value>

source§

impl IntoSort for ()

§

type Sort = UnitSort

source§

fn store(self, _sort: &Self::Sort) -> Option<Value>

source§

impl IntoSort for BTreeMap<Value, Value>

§

type Sort = MapSort

source§

fn store(self, sort: &Self::Sort) -> Option<Value>

source§

impl IntoSort for BTreeSet<Value>

§

type Sort = SetSort

source§

fn store(self, sort: &Self::Sort) -> Option<Value>

source§

impl IntoSort for Vec<Value>

§

type Sort = VecSort

source§

fn store(self, sort: &Self::Sort) -> Option<Value>

source§

impl IntoSort for BigInt

§

type Sort = BigIntSort

source§

fn store(self, _sort: &Self::Sort) -> Option<Value>

source§

impl IntoSort for BigRational

§

type Sort = BigRatSort

source§

fn store(self, _sort: &Self::Sort) -> Option<Value>

source§

impl IntoSort for Rational64

§

type Sort = RationalSort

source§

fn store(self, _sort: &Self::Sort) -> Option<Value>

source§

impl<T: IntoSort> IntoSort for Option<T>

§

type Sort = <T as IntoSort>::Sort

source§

fn store(self, sort: &Self::Sort) -> Option<Value>

Implementors§

\ No newline at end of file diff --git a/docs/egglog/sort/trait.Presort.html b/docs/egglog/sort/trait.Presort.html new file mode 100644 index 00000000..34251b54 --- /dev/null +++ b/docs/egglog/sort/trait.Presort.html @@ -0,0 +1,14 @@ +Presort in egglog::sort - Rust

Trait egglog::sort::Presort

source ·
pub trait Presort {
+    // Required methods
+    fn presort_name() -> Symbol;
+    fn reserved_primitives() -> Vec<Symbol>;
+    fn make_sort(
+        typeinfo: &mut TypeInfo,
+        name: Symbol,
+        args: &[Expr]
+    ) -> Result<ArcSort, TypeError>;
+}

Required Methods§

source

fn presort_name() -> Symbol

source

fn reserved_primitives() -> Vec<Symbol>

source

fn make_sort( + typeinfo: &mut TypeInfo, + name: Symbol, + args: &[Expr] +) -> Result<ArcSort, TypeError>

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/docs/egglog/sort/trait.Sort.html b/docs/egglog/sort/trait.Sort.html new file mode 100644 index 00000000..cd6b3c5e --- /dev/null +++ b/docs/egglog/sort/trait.Sort.html @@ -0,0 +1,46 @@ +Sort in egglog::sort - Rust

Trait egglog::sort::Sort

source ·
pub trait Sort: Any + Send + Sync + Debug {
+    // Required methods
+    fn name(&self) -> Symbol;
+    fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>;
+    fn make_expr(&self, egraph: &EGraph, value: Value) -> (usize, Expr);
+
+    // Provided methods
+    fn is_eq_sort(&self) -> bool { ... }
+    fn is_container_sort(&self) -> bool { ... }
+    fn is_eq_container_sort(&self) -> bool { ... }
+    fn foreach_tracked_values<'a>(
+        &'a self,
+        value: &'a Value,
+        f: Box<dyn FnMut(ArcSort, Value) + 'a>
+    ) { ... }
+    fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool { ... }
+    fn serialized_name(&self, _value: &Value) -> Symbol { ... }
+    fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)> { ... }
+    fn register_primitives(self: Arc<Self>, info: &mut TypeInfo) { ... }
+    fn extract_expr(
+        &self,
+        egraph: &EGraph,
+        value: Value,
+        _extractor: &Extractor<'_>,
+        _termdag: &mut TermDag
+    ) -> Option<(usize, Expr)> { ... }
+}

Required Methods§

source

fn name(&self) -> Symbol

source

fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>

source

fn make_expr(&self, egraph: &EGraph, value: Value) -> (usize, Expr)

Extracting an expression (with smallest cost) out of a primitive value

+

Provided Methods§

source

fn is_eq_sort(&self) -> bool

source

fn is_container_sort(&self) -> bool

source

fn is_eq_container_sort(&self) -> bool

source

fn foreach_tracked_values<'a>( + &'a self, + value: &'a Value, + f: Box<dyn FnMut(ArcSort, Value) + 'a> +)

source

fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool

source

fn serialized_name(&self, _value: &Value) -> Symbol

Return the serialized name of the sort

+

Only used for container sorts, which cannot be serialized with make_expr so need an explicit name

+
source

fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)>

Return the inner values and sorts. +Only eq_container_sort need to implement this method,

+
source

fn register_primitives(self: Arc<Self>, info: &mut TypeInfo)

source

fn extract_expr( + &self, + egraph: &EGraph, + value: Value, + _extractor: &Extractor<'_>, + _termdag: &mut TermDag +) -> Option<(usize, Expr)>

For values like EqSort containers, to make/extract an expression from it +requires an extractor. Moreover, the extraction may be unsuccessful if +the extractor is not fully initialized.

+

The default behavior is to call make_expr

+

Implementors§

\ No newline at end of file diff --git a/docs/egglog/sort/type.PreSort.html b/docs/egglog/sort/type.PreSort.html new file mode 100644 index 00000000..5ba4b9a0 --- /dev/null +++ b/docs/egglog/sort/type.PreSort.html @@ -0,0 +1 @@ +PreSort in egglog::sort - Rust

Type Alias egglog::sort::PreSort

source ·
pub type PreSort = fn(typeinfo: &mut TypeInfo, name: Symbol, params: &[Expr]) -> Result<ArcSort, TypeError>;
\ No newline at end of file diff --git a/docs/egglog/sort/unit/struct.NotEqualPrimitive.html b/docs/egglog/sort/unit/struct.NotEqualPrimitive.html new file mode 100644 index 00000000..440746aa --- /dev/null +++ b/docs/egglog/sort/unit/struct.NotEqualPrimitive.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../egglog/sort/struct.NotEqualPrimitive.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/sort/unit/struct.UnitSort.html b/docs/egglog/sort/unit/struct.UnitSort.html new file mode 100644 index 00000000..04d2725b --- /dev/null +++ b/docs/egglog/sort/unit/struct.UnitSort.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../egglog/sort/struct.UnitSort.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/sort/vec/struct.VecSort.html b/docs/egglog/sort/vec/struct.VecSort.html new file mode 100644 index 00000000..c53ac6c6 --- /dev/null +++ b/docs/egglog/sort/vec/struct.VecSort.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../egglog/sort/struct.VecSort.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/struct.EGraph.html b/docs/egglog/struct.EGraph.html new file mode 100644 index 00000000..e12418a5 --- /dev/null +++ b/docs/egglog/struct.EGraph.html @@ -0,0 +1,118 @@ +EGraph in egglog - Rust

Struct egglog::EGraph

source ·
pub struct EGraph {
+    pub functions: IndexMap<Symbol, Function>,
+    pub run_mode: RunMode,
+    pub fact_directory: Option<PathBuf>,
+    pub seminaive: bool,
+    /* private fields */
+}

Fields§

§functions: IndexMap<Symbol, Function>§run_mode: RunMode§fact_directory: Option<PathBuf>§seminaive: bool

Implementations§

source§

impl EGraph

source

pub fn extract( + &self, + value: Value, + termdag: &mut TermDag, + arcsort: &ArcSort +) -> (usize, Term)

This example uses EGraph::extract to extract a term. The example is +trivial, as there is only a single variant of the expression in the +egraph.

+ +
use egglog::{EGraph, TermDag};
+let mut egraph = EGraph::default();
+egraph
+    .parse_and_run_program(
+        None,
+        "(datatype Op (Add i64 i64))
+         (let expr (Add 1 1))",
+    )
+    .unwrap();
+let mut termdag = TermDag::default();
+let (sort, value) = egraph
+    .eval_expr(&egglog::ast::Expr::var_no_span("expr"))
+    .unwrap();
+let (_, extracted) = egraph.extract(value, &mut termdag, &sort);
+assert_eq!(termdag.to_string(&extracted), "(Add 1 1)");
+
source

pub fn extract_variants( + &mut self, + sort: &ArcSort, + value: Value, + limit: usize, + termdag: &mut TermDag +) -> Vec<Term>

source§

impl EGraph

source

pub fn serialize(&self, config: SerializeConfig) -> EGraph

Serialize the egraph into a format that can be read by the egraph-serialize crate.

+

There are multiple different semantically valid ways to do this. This is how this implementation does it:

+

For node costs:

+
    +
  • Primitives: 1.0
  • +
  • Function without costs: 1.0
  • +
  • Function with costs: the cost
  • +
  • Omitted nodes: infinite
  • +
+

For node IDs:

+
    +
  • Functions: Function name + hash of input values
  • +
  • Args which are eq sorts: Choose one ID from the e-class, distribute roughly evenly.
  • +
  • Args and outputs values which are primitives: Sort name + hash of value
  • +
+

For e-classes IDs:

+
    +
  • tag and value of canonicalized value
  • +
+

This is to achieve the following properties:

+
    +
  • Equivalent primitive values will show up once in the e-graph.
  • +
  • Functions which return primitive values will be added to the e-class of that value.
  • +
  • Nodes will have consistant IDs throughout execution of e-graph (used for animating changes in the visualization)
  • +
  • Edges in the visualization will be well distributed (used for animating changes in the visualization) +(Note that this will be changed in <https://github.com/egraphs-good/egglog/pull/158> so that edges point to exact nodes instead of looking up the e-class)
  • +
+
source

pub fn value_to_class_id(&self, sort: &ArcSort, value: &Value) -> ClassId

Gets the serialized class ID for a value.

+
source

pub fn class_id_to_value(&self, eclass_id: &ClassId) -> Value

Gets the value for a serialized class ID.

+
source

pub fn to_node_id(&self, sort: Option<&ArcSort>, node: SerializedNode) -> NodeId

Gets the serialized node ID for the primitive, omitted, or function value.

+
source

pub fn from_node_id(&self, node_id: &NodeId) -> SerializedNode

Gets the serialized node for the node ID.

+
source§

impl EGraph

source

pub fn is_interactive_mode(&self) -> bool

source

pub fn push(&mut self)

source

pub fn pop(&mut self) -> Result<(), Error>

Pop the current egraph off the stack, replacing +it with the previously pushed egraph. +It preserves the run report and messages from the popped +egraph.

+
source

pub fn union(&mut self, id1: u64, id2: u64, sort: Symbol) -> u64

source

pub fn find(&self, sort: &ArcSort, value: Value) -> Value

find the leader value for a particular eclass

+
source

pub fn rebuild_nofail(&mut self) -> usize

source

pub fn rebuild(&mut self) -> Result<usize, Error>

source

pub fn eval_lit(&self, lit: &Literal) -> Value

source

pub fn function_to_dag( + &mut self, + sym: Symbol, + n: usize +) -> Result<(Vec<(Term, Term)>, TermDag), Error>

source

pub fn print_function(&mut self, sym: Symbol, n: usize) -> Result<(), Error>

source

pub fn print_size(&mut self, sym: Option<Symbol>) -> Result<(), Error>

source

pub fn extract_value(&self, sort: &ArcSort, value: Value) -> (TermDag, Term)

Extract a value to a TermDag and Term in the TermDag. +Note that the TermDag may contain a superset of the nodes in the Term. +See also extract_value_to_string for convenience.

+
source

pub fn extract_value_to_string(&self, sort: &ArcSort, value: Value) -> String

Extract a value to a string for printing. +See also extract_value for more control.

+
source

pub fn eval_expr(&mut self, expr: &Expr) -> Result<(ArcSort, Value), Error>

source

pub fn clear(&mut self)

source

pub fn set_reserved_symbol(&mut self, sym: Symbol)

source

pub fn run_program( + &mut self, + program: Vec<Command> +) -> Result<Vec<String>, Error>

Run a program, represented as an AST. +Return a list of messages.

+
source

pub fn parse_and_run_program( + &mut self, + filename: Option<String>, + input: &str +) -> Result<Vec<String>, Error>

Takes a source program input, parses it, runs it, and returns a list of messages.

+

filename is an optional argument to indicate the source of +the program for error reporting. If filename is None, +a default name will be used.

+
source

pub fn num_tuples(&self) -> usize

source

pub fn get_sort<S: Sort + Send + Sync>(&self) -> Option<Arc<S>>

Returns a sort based on the type

+
source

pub fn get_sort_by<S: Sort + Send + Sync>( + &self, + pred: impl Fn(&Arc<S>) -> bool +) -> Option<Arc<S>>

Returns the first sort that satisfies the type and predicate if there’s one. +Otherwise returns none.

+
source

pub fn add_arcsort(&mut self, arcsort: ArcSort) -> Result<(), TypeError>

Add a user-defined sort

+
source

pub fn add_primitive(&mut self, prim: impl Into<Primitive>)

Add a user-defined primitive

+
source

pub fn get_extract_report(&self) -> &Option<ExtractReport>

Gets the last extract report and returns it, if the last command saved it.

+
source

pub fn get_run_report(&self) -> &Option<RunReport>

Gets the last run report and returns it, if the last command saved it.

+
source

pub fn get_overall_run_report(&self) -> &RunReport

Gets the overall run report and returns it.

+

Trait Implementations§

source§

impl Clone for EGraph

source§

fn clone(&self) -> EGraph

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for EGraph

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for EGraph

§

impl !RefUnwindSafe for EGraph

§

impl !Send for EGraph

§

impl !Sync for EGraph

§

impl Unpin for EGraph

§

impl !UnwindSafe for EGraph

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/struct.Function.html b/docs/egglog/struct.Function.html new file mode 100644 index 00000000..0064fe2d --- /dev/null +++ b/docs/egglog/struct.Function.html @@ -0,0 +1,33 @@ +Function in egglog - Rust

Struct egglog::Function

source ·
pub struct Function {
+    pub schema: ResolvedSchema,
+    pub merge: MergeAction,
+    /* private fields */
+}

Fields§

§schema: ResolvedSchema§merge: MergeAction

Implementations§

source§

impl Function

source

pub fn get(&self, inputs: &[Value]) -> Option<Value>

source

pub fn insert( + &mut self, + inputs: &[Value], + value: Value, + timestamp: u32 +) -> Option<Value>

source

pub fn clear(&mut self)

source

pub fn insert_internal( + &mut self, + inputs: &[Value], + value: Value, + timestamp: u32, + maybe_rehash: bool +) -> Option<Value>

source

pub fn subsume(&mut self, inputs: &[Value])

Mark the given inputs as subsumed.

+
source

pub fn rebuild( + &mut self, + uf: &mut UnionFind, + timestamp: u32 +) -> Result<(usize, Vec<(SmallVec<[Value; 3]>, Value, Value)>), Error>

source

pub fn is_extractable(&self) -> bool

Trait Implementations§

source§

impl Clone for Function

source§

fn clone(&self) -> Function

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Function

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/struct.NotFoundError.html b/docs/egglog/struct.NotFoundError.html new file mode 100644 index 00000000..8bba60e7 --- /dev/null +++ b/docs/egglog/struct.NotFoundError.html @@ -0,0 +1,13 @@ +NotFoundError in egglog - Rust

Struct egglog::NotFoundError

source ·
pub struct NotFoundError(/* private fields */);

Trait Implementations§

source§

impl Debug for NotFoundError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for NotFoundError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for NotFoundError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<NotFoundError> for Error

source§

fn from(source: NotFoundError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/struct.Primitive.html b/docs/egglog/struct.Primitive.html new file mode 100644 index 00000000..b97d1e6e --- /dev/null +++ b/docs/egglog/struct.Primitive.html @@ -0,0 +1,19 @@ +Primitive in egglog - Rust

Struct egglog::Primitive

source ·
pub struct Primitive(/* private fields */);

Trait Implementations§

source§

impl Clone for Primitive

source§

fn clone(&self) -> Primitive

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Primitive

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: PrimitiveLike + 'static> From<T> for Primitive

source§

fn from(p: T) -> Self

Converts to this type from the input type.
source§

impl Hash for Primitive

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Primitive

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Deref for Primitive

§

type Target = dyn PrimitiveLike

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Eq for Primitive

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/struct.RunReport.html b/docs/egglog/struct.RunReport.html new file mode 100644 index 00000000..eb8a2159 --- /dev/null +++ b/docs/egglog/struct.RunReport.html @@ -0,0 +1,30 @@ +RunReport in egglog - Rust

Struct egglog::RunReport

source ·
pub struct RunReport {
+    pub updated: bool,
+    pub search_time_per_rule: HashMap<Symbol, Duration, BuildHasherDefault<FxHasher>>,
+    pub apply_time_per_rule: HashMap<Symbol, Duration, BuildHasherDefault<FxHasher>>,
+    pub search_time_per_ruleset: HashMap<Symbol, Duration, BuildHasherDefault<FxHasher>>,
+    pub num_matches_per_rule: HashMap<Symbol, usize, BuildHasherDefault<FxHasher>>,
+    pub apply_time_per_ruleset: HashMap<Symbol, Duration, BuildHasherDefault<FxHasher>>,
+    pub rebuild_time_per_ruleset: HashMap<Symbol, Duration, BuildHasherDefault<FxHasher>>,
+}
Expand description

Running a schedule produces a report of the results. +This includes rough timing information and whether +the database was updated. +Calling union on two run reports adds the timing +information together.

+

Fields§

§updated: bool

If any changes were made to the database, this is +true.

+
§search_time_per_rule: HashMap<Symbol, Duration, BuildHasherDefault<FxHasher>>

The time it took to run the query, for each rule.

+
§apply_time_per_rule: HashMap<Symbol, Duration, BuildHasherDefault<FxHasher>>§search_time_per_ruleset: HashMap<Symbol, Duration, BuildHasherDefault<FxHasher>>§num_matches_per_rule: HashMap<Symbol, usize, BuildHasherDefault<FxHasher>>§apply_time_per_ruleset: HashMap<Symbol, Duration, BuildHasherDefault<FxHasher>>§rebuild_time_per_ruleset: HashMap<Symbol, Duration, BuildHasherDefault<FxHasher>>

Implementations§

source§

impl RunReport

source

pub fn union(&self, other: &Self) -> Self

Trait Implementations§

source§

impl Clone for RunReport

source§

fn clone(&self) -> RunReport

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RunReport

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for RunReport

source§

fn default() -> RunReport

Returns the “default value” for a type. Read more
source§

impl Display for RunReport

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/struct.SerializeConfig.html b/docs/egglog/struct.SerializeConfig.html new file mode 100644 index 00000000..afddebfc --- /dev/null +++ b/docs/egglog/struct.SerializeConfig.html @@ -0,0 +1,18 @@ +SerializeConfig in egglog - Rust

Struct egglog::SerializeConfig

source ·
pub struct SerializeConfig {
+    pub max_functions: Option<usize>,
+    pub max_calls_per_function: Option<usize>,
+    pub include_temporary_functions: bool,
+    pub root_eclasses: Vec<(ArcSort, Value)>,
+}

Fields§

§max_functions: Option<usize>§max_calls_per_function: Option<usize>§include_temporary_functions: bool§root_eclasses: Vec<(ArcSort, Value)>

Trait Implementations§

source§

impl Default for SerializeConfig

Default is used for exporting JSON and will output all nodes.

+
source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/struct.SimplePrimitive.html b/docs/egglog/struct.SimplePrimitive.html new file mode 100644 index 00000000..02c9b828 --- /dev/null +++ b/docs/egglog/struct.SimplePrimitive.html @@ -0,0 +1,18 @@ +SimplePrimitive in egglog - Rust

Struct egglog::SimplePrimitive

source ·
pub struct SimplePrimitive { /* private fields */ }

Trait Implementations§

source§

impl PrimitiveLike for SimplePrimitive

source§

fn name(&self) -> Symbol

source§

fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint>

Constructs a type constraint for the primitive that uses the span information +for error localization.
source§

fn apply( + &self, + values: &[Value], + _sorts: (&[ArcSort], &ArcSort), + _egraph: Option<&mut EGraph> +) -> Option<Value>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/struct.TermDag.html b/docs/egglog/struct.TermDag.html new file mode 100644 index 00000000..bd462c29 --- /dev/null +++ b/docs/egglog/struct.TermDag.html @@ -0,0 +1,38 @@ +TermDag in egglog - Rust

Struct egglog::TermDag

source ·
pub struct TermDag { /* private fields */ }
Expand description

A hashconsing arena for Terms.

+

Implementations§

source§

impl TermDag

source

pub fn size(&self) -> usize

Returns the number of nodes in this DAG.

+
source

pub fn lookup(&self, node: &Term) -> TermId

Convert the given term to its id.

+

Panics if the term does not already exist in this TermDag.

+
source

pub fn get(&self, id: TermId) -> &Term

Convert the given id to the corresponding term.

+

Panics if the id is not valid.

+
source

pub fn app(&mut self, sym: Symbol, children: Vec<Term>) -> Term

Make and return a Term::App with the given head symbol and children, +and insert into the DAG if it is not already present.

+

Panics if any of the children are not already in the DAG.

+
source

pub fn lit(&mut self, lit: Literal) -> Term

Make and return a Term::Lit with the given literal, and insert into +the DAG if it is not already present.

+
source

pub fn var(&mut self, sym: Symbol) -> Term

Make and return a Term::Var with the given symbol, and insert into +the DAG if it is not already present.

+
source

pub fn expr_to_term(&mut self, expr: &GenericExpr<Symbol, Symbol>) -> Term

Recursively converts the given expression to a term.

+

This involves inserting every subexpression into this DAG. Because +TermDags are hashconsed, the resulting term is guaranteed to maximally +share subterms.

+
source

pub fn term_to_expr(&self, term: &Term) -> Expr

Recursively converts the given term to an expression.

+

Panics if the term contains subterms that are not in the DAG.

+
source

pub fn to_string(&self, term: &Term) -> String

Converts the given term to a string.

+

Panics if the term or any of its subterms are not in the DAG.

+

Trait Implementations§

source§

impl Clone for TermDag

source§

fn clone(&self) -> TermDag

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TermDag

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for TermDag

source§

fn default() -> TermDag

Returns the “default value” for a type. Read more
source§

impl PartialEq for TermDag

source§

fn eq(&self, other: &TermDag) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for TermDag

source§

impl StructuralPartialEq for TermDag

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/struct.TypeInfo.html b/docs/egglog/struct.TypeInfo.html new file mode 100644 index 00000000..17f0cbc5 --- /dev/null +++ b/docs/egglog/struct.TypeInfo.html @@ -0,0 +1,39 @@ +TypeInfo in egglog - Rust

Struct egglog::TypeInfo

source ·
pub struct TypeInfo {
+    pub presorts: HashMap<Symbol, PreSort, BuildHasherDefault<FxHasher>>,
+    pub reserved_primitives: HashSet<Symbol, BuildHasherDefault<FxHasher>>,
+    pub sorts: HashMap<Symbol, Arc<dyn Sort>, BuildHasherDefault<FxHasher>>,
+    pub primitives: HashMap<Symbol, Vec<Primitive>, BuildHasherDefault<FxHasher>>,
+    pub func_types: HashMap<Symbol, FuncType, BuildHasherDefault<FxHasher>>,
+    pub global_types: HashMap<Symbol, ArcSort, BuildHasherDefault<FxHasher>>,
+}
Expand description

Stores resolved typechecking information. +TODO make these not public, use accessor methods

+

Fields§

§presorts: HashMap<Symbol, PreSort, BuildHasherDefault<FxHasher>>§reserved_primitives: HashSet<Symbol, BuildHasherDefault<FxHasher>>§sorts: HashMap<Symbol, Arc<dyn Sort>, BuildHasherDefault<FxHasher>>§primitives: HashMap<Symbol, Vec<Primitive>, BuildHasherDefault<FxHasher>>§func_types: HashMap<Symbol, FuncType, BuildHasherDefault<FxHasher>>§global_types: HashMap<Symbol, ArcSort, BuildHasherDefault<FxHasher>>

Implementations§

source§

impl TypeInfo

source

pub fn add_sort<S: Sort + 'static>( + &mut self, + sort: S, + span: Span +) -> Result<(), TypeError>

source

pub fn add_presort<S: Presort>(&mut self, span: Span) -> Result<(), TypeError>

Adds a sort constructor to the typechecker’s known set of types.

+
source

pub fn add_arcsort( + &mut self, + sort: ArcSort, + span: Span +) -> Result<(), TypeError>

source

pub fn get_sort_by<S: Sort + Send + Sync>( + &self, + pred: impl Fn(&Arc<S>) -> bool +) -> Option<Arc<S>>

source

pub fn get_sort_nofail<S: Sort + Send + Sync>(&self) -> Arc<S>

source

pub fn add_primitive(&mut self, prim: impl Into<Primitive>)

source

pub fn declare_sort( + &mut self, + name: impl Into<Symbol>, + presort_and_args: &Option<(Symbol, Vec<Expr>)>, + span: Span +) -> Result<(), TypeError>

source

pub fn lookup_global(&self, sym: &Symbol) -> Option<ArcSort>

Trait Implementations§

source§

impl Clone for TypeInfo

source§

fn clone(&self) -> TypeInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for TypeInfo

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/struct.Value.html b/docs/egglog/struct.Value.html new file mode 100644 index 00000000..828933ec --- /dev/null +++ b/docs/egglog/struct.Value.html @@ -0,0 +1,30 @@ +Value in egglog - Rust

Struct egglog::Value

source ·
pub struct Value {
+    pub tag: Symbol,
+    pub bits: u64,
+}

Fields§

§tag: Symbol§bits: u64

Implementations§

source§

impl Value

source

pub fn unit() -> Self

source

pub fn fake() -> Self

Trait Implementations§

source§

impl Clone for Value

source§

fn clone(&self) -> Value

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Value

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<GlobalSymbol> for Value

source§

fn from(s: Symbol) -> Self

Converts to this type from the input type.
source§

impl From<OrderedFloat<f64>> for Value

source§

fn from(f: OrderedFloat<f64>) -> Self

Converts to this type from the input type.
source§

impl From<bool> for Value

source§

fn from(b: bool) -> Self

Converts to this type from the input type.
source§

impl From<i64> for Value

source§

fn from(i: i64) -> Self

Converts to this type from the input type.
source§

impl Hash for Value

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Value

source§

fn cmp(&self, other: &Value) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Value

source§

fn eq(&self, other: &Value) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Value

source§

fn partial_cmp(&self, other: &Value) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Copy for Value

source§

impl Eq for Value

source§

impl StructuralPartialEq for Value

Auto Trait Implementations§

§

impl Freeze for Value

§

impl RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnwindSafe for Value

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> RuleType for T
where + T: Copy + Debug + Eq + Hash + Ord,

\ No newline at end of file diff --git a/docs/egglog/termdag/enum.Term.html b/docs/egglog/termdag/enum.Term.html new file mode 100644 index 00000000..165475ec --- /dev/null +++ b/docs/egglog/termdag/enum.Term.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../egglog/enum.Term.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/termdag/struct.TermDag.html b/docs/egglog/termdag/struct.TermDag.html new file mode 100644 index 00000000..5a40af8f --- /dev/null +++ b/docs/egglog/termdag/struct.TermDag.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../egglog/struct.TermDag.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/termdag/type.TermId.html b/docs/egglog/termdag/type.TermId.html new file mode 100644 index 00000000..d840cd48 --- /dev/null +++ b/docs/egglog/termdag/type.TermId.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../egglog/type.TermId.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/trait.PrimitiveLike.html b/docs/egglog/trait.PrimitiveLike.html new file mode 100644 index 00000000..f7d49f32 --- /dev/null +++ b/docs/egglog/trait.PrimitiveLike.html @@ -0,0 +1,18 @@ +PrimitiveLike in egglog - Rust

Trait egglog::PrimitiveLike

source ·
pub trait PrimitiveLike {
+    // Required methods
+    fn name(&self) -> Symbol;
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint>;
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        egraph: Option<&mut EGraph>
+    ) -> Option<Value>;
+}

Required Methods§

source

fn name(&self) -> Symbol

source

fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint>

Constructs a type constraint for the primitive that uses the span information +for error localization.

+
source

fn apply( + &self, + values: &[Value], + _sorts: (&[ArcSort], &ArcSort), + egraph: Option<&mut EGraph> +) -> Option<Value>

Implementors§

\ No newline at end of file diff --git a/docs/egglog/type.ArcSort.html b/docs/egglog/type.ArcSort.html new file mode 100644 index 00000000..0e320166 --- /dev/null +++ b/docs/egglog/type.ArcSort.html @@ -0,0 +1 @@ +ArcSort in egglog - Rust

Type Alias egglog::ArcSort

source ·
pub type ArcSort = Arc<dyn Sort>;

Aliased Type§

struct ArcSort { /* private fields */ }
\ No newline at end of file diff --git a/docs/egglog/type.Subst.html b/docs/egglog/type.Subst.html new file mode 100644 index 00000000..16cc35a3 --- /dev/null +++ b/docs/egglog/type.Subst.html @@ -0,0 +1 @@ +Subst in egglog - Rust

Type Alias egglog::Subst

source ·
pub type Subst = IndexMap<Symbol, Value>;

Aliased Type§

struct Subst { /* private fields */ }
\ No newline at end of file diff --git a/docs/egglog/type.TermId.html b/docs/egglog/type.TermId.html new file mode 100644 index 00000000..aa2d1c56 --- /dev/null +++ b/docs/egglog/type.TermId.html @@ -0,0 +1 @@ +TermId in egglog - Rust

Type Alias egglog::TermId

source ·
pub type TermId = usize;
\ No newline at end of file diff --git a/docs/egglog/typechecking/struct.TypeInfo.html b/docs/egglog/typechecking/struct.TypeInfo.html new file mode 100644 index 00000000..73bba124 --- /dev/null +++ b/docs/egglog/typechecking/struct.TypeInfo.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../egglog/struct.TypeInfo.html...

+ + + \ No newline at end of file diff --git a/docs/egglog/util/index.html b/docs/egglog/util/index.html new file mode 100644 index 00000000..4676d895 --- /dev/null +++ b/docs/egglog/util/index.html @@ -0,0 +1,3 @@ +egglog::util - Rust

Module egglog::util

source ·

Structs§

  • Generates fresh symbols for internal use during typechecking and flattening. +These are guaranteed not to collide with the +user’s symbols because they use $.

Traits§

  • This trait lets us statically dispatch between fresh methods for generic structs.

Type Aliases§

\ No newline at end of file diff --git a/docs/egglog/util/sidebar-items.js b/docs/egglog/util/sidebar-items.js new file mode 100644 index 00000000..57fa0ac6 --- /dev/null +++ b/docs/egglog/util/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["SymbolGen"],"trait":["FreshGen"],"type":["IndexMap","IndexSet"]}; \ No newline at end of file diff --git a/docs/egglog/util/struct.SymbolGen.html b/docs/egglog/util/struct.SymbolGen.html new file mode 100644 index 00000000..d8f5f7e7 --- /dev/null +++ b/docs/egglog/util/struct.SymbolGen.html @@ -0,0 +1,20 @@ +SymbolGen in egglog::util - Rust

Struct egglog::util::SymbolGen

source ·
pub struct SymbolGen { /* private fields */ }
Expand description

Generates fresh symbols for internal use during typechecking and flattening. +These are guaranteed not to collide with the +user’s symbols because they use $.

+

Implementations§

source§

impl SymbolGen

source

pub fn new(reserved_string: String) -> Self

source

pub fn has_been_used(&self) -> bool

Trait Implementations§

source§

impl Clone for SymbolGen

source§

fn clone(&self) -> SymbolGen

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SymbolGen

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FreshGen<GlobalSymbol, GlobalSymbol> for SymbolGen

source§

fn fresh(&mut self, name_hint: &Symbol) -> Symbol

source§

impl PartialEq for SymbolGen

source§

fn eq(&self, other: &SymbolGen) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for SymbolGen

source§

impl StructuralPartialEq for SymbolGen

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/docs/egglog/util/trait.FreshGen.html b/docs/egglog/util/trait.FreshGen.html new file mode 100644 index 00000000..2d5f3004 --- /dev/null +++ b/docs/egglog/util/trait.FreshGen.html @@ -0,0 +1,5 @@ +FreshGen in egglog::util - Rust

Trait egglog::util::FreshGen

source ·
pub trait FreshGen<Head, Leaf> {
+    // Required method
+    fn fresh(&mut self, name_hint: &Head) -> Leaf;
+}
Expand description

This trait lets us statically dispatch between fresh methods for generic structs.

+

Required Methods§

source

fn fresh(&mut self, name_hint: &Head) -> Leaf

Implementors§

\ No newline at end of file diff --git a/docs/egglog/util/type.IndexMap.html b/docs/egglog/util/type.IndexMap.html new file mode 100644 index 00000000..e14a34d7 --- /dev/null +++ b/docs/egglog/util/type.IndexMap.html @@ -0,0 +1 @@ +IndexMap in egglog::util - Rust

Type Alias egglog::util::IndexMap

source ·
pub type IndexMap<K, V> = IndexMap<K, V, BuildHasherDefault<FxHasher>>;

Aliased Type§

struct IndexMap<K, V> { /* private fields */ }
\ No newline at end of file diff --git a/docs/egglog/util/type.IndexSet.html b/docs/egglog/util/type.IndexSet.html new file mode 100644 index 00000000..ec8e2365 --- /dev/null +++ b/docs/egglog/util/type.IndexSet.html @@ -0,0 +1 @@ +IndexSet in egglog::util - Rust

Type Alias egglog::util::IndexSet

source ·
pub type IndexSet<K> = IndexSet<K, BuildHasherDefault<FxHasher>>;

Aliased Type§

struct IndexSet<K> { /* private fields */ }
\ No newline at end of file diff --git a/docs/egglog/value/struct.Value.html b/docs/egglog/value/struct.Value.html new file mode 100644 index 00000000..de6e67ee --- /dev/null +++ b/docs/egglog/value/struct.Value.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../egglog/struct.Value.html...

+ + + \ No newline at end of file diff --git a/docs/help.html b/docs/help.html new file mode 100644 index 00000000..89baff06 --- /dev/null +++ b/docs/help.html @@ -0,0 +1 @@ +Help

Rustdoc help

Back
\ No newline at end of file diff --git a/docs/search-index.js b/docs/search-index.js new file mode 100644 index 00000000..79f7ce64 --- /dev/null +++ b/docs/search-index.js @@ -0,0 +1,5 @@ +var searchIndex = new Map(JSON.parse('[\ +["egglog",{"t":"PIPPPPFGPGFPPPPPPFPPPFPPKGFFGPFPIPGFIPPFFPPNNNNNNNMNOOCONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONONNNNNNNNNMNONNNNONNNNNNNNNNNNNNNNNNNNNNNQOOOMNONNNNOONNNNNNOOOONOOOONNNCONNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOCNNNNNNNNNNNNNNNNNOOOOOOOIPPIPPPPPPPPPGPPPPPPIPPFPPPPPPPIPPPPPIPPFPPPPPPPPIGFGGGFGFFFGFPPPPPPPPPPPGIPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPFIPPIPPPPIPPPPPPIFPPPPPPPPPPPPPPPGIPFKPPPPPPPPPFPNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOONOOCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOONNNNNNNNNNNNNNNNNNNNNONOONNNNNOOOOOOOONNNNONCNNNNOOOOOONOONOOOOOOONNNNONNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPFPPPPPPGFPPPNNNNNNNNNNNNNNNNNNNNNNNHHNNNNNNNNNNNNNNNNFPPPGGPPPPGPPFFKPPNNNNNNNNNNNNNNNONNNNNNNNNNMNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOFFFFFKFFKFFFIKFFKRRFFFNNMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNHMMNNNNNNNNNNNNNNMNNNNNMNNNNNNNNNNNNNNNOOMNNNNNNNNNNNNNNNNNNNMNNNNNNNNNNMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNKIIFNNNNNNNNMNNNNNNNNNN","n":["App","ArcSort","Best","CheckError","CombinedRulesetError","Dummy","EGraph","Error","ExpectFail","ExtractReport","Function","Function","IoError","Lit","MergeError","NoSuchRuleset","Normal","NotFoundError","NotFoundError","ParseError","Pop","Primitive","Primitive","PrimitiveError","PrimitiveLike","RunMode","RunReport","SerializeConfig","SerializedNode","ShowDesugaredEgglog","SimplePrimitive","Split","Subst","SubsumeMergeError","Term","TermDag","TermId","TypeError","TypeErrors","TypeInfo","Value","Var","Variants","add_arcsort","add_arcsort","add_presort","add_primitive","add_primitive","add_sort","app","apply","apply","apply_time_per_rule","apply_time_per_ruleset","ast","bits","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","class_id_to_value","clear","clear","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","compare","constraint","declare_sort","default","default","default","default","default","deref","eq","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","eval_expr","eval_lit","expr_to_term","extract","extract_value","extract_value_to_string","extract_variants","fact_directory","fake","find","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_node_id","from_str","func_types","function_to_dag","functions","get","get","get_extract_report","get_overall_run_report","get_run_report","get_sort","get_sort_by","get_sort_by","get_sort_nofail","get_type_constraints","get_type_constraints","global_types","hash","hash","hash","hash","include_temporary_functions","insert","insert_internal","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","is_extractable","is_interactive_mode","is_primitive","lit","lookup","lookup_global","match_term_app","max_calls_per_function","max_functions","merge","name","name","num_matches_per_rule","num_tuples","parse_and_run_program","partial_cmp","pop","presorts","primitives","print_function","print_size","push","rebuild","rebuild","rebuild_nofail","rebuild_time_per_ruleset","reserved_primitives","root_eclasses","run_mode","run_program","schema","search_time_per_rule","search_time_per_ruleset","seminaive","serialize","set_reserved_symbol","size","sort","sorts","source","subsume","tag","term_to_expr","to_node_id","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","union","union","unit","updated","util","value_to_class_id","var","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","cost","term","termdag","termdag","terms","name","offset","Action","Action","Action","Actions","AddRuleset","AddRuleset","AddRuleset","AddRuleset","BiRewrite","BiRewrite","Bool","Call","Call","Change","Change","Change","Check","Check","Check","Check","Command","CoreAction","CoreAction","CorrespondingVar","Datatype","Datatype","Datatypes","Datatypes","Delete","Eq","Eq","Expr","Expr","Expr","Extract","Extract","F64","Fact","Fact","Fact","Facts","Fail","Fail","Fail","Fail","Function","Function","Function","Function","FunctionDecl","GenericAction","GenericActions","GenericCommand","GenericExpr","GenericFact","GenericFunctionDecl","GenericNCommand","GenericRewrite","GenericRule","GenericRunConfig","GenericSchedule","IdentSort","Include","Include","Input","Input","Input","Input","Int","Let","Let","Lit","Lit","Literal","NCommand","NewSort","NormRule","NormRule","Output","Output","Output","Output","Panic","Panic","Pop","Pop","Pop","Pop","PrintFunction","PrintFunction","PrintOverallStatistics","PrintOverallStatistics","PrintOverallStatistics","PrintOverallStatistics","PrintSize","PrintSize","PrintSize","PrintSize","PrintTable","PrintTable","Push","Push","Push","Push","QueryExtract","QueryExtract","Relation","Relation","Repeat","Repeat","ResolvedVar","Rewrite","Rewrite","Rewrite","Rule","Rule","Rule","Run","Run","RunConfig","RunSchedule","RunSchedule","RunSchedule","RunSchedule","Saturate","Saturate","Schedule","Schema","Sequence","Sequence","Set","Set","SetOption","SetOption","SetOption","SetOption","Simplify","Simplify","Sort","Sort","Sort","Sort","String","Subdatatypes","Subsume","Subsume","Symbol","ToSexp","Union","Union","Unit","UnstableCombinedRuleset","UnstableCombinedRuleset","UnstableCombinedRuleset","UnstableCombinedRuleset","Var","Var","Variant","Variants","as_str","ast_size","body","body","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","call_no_span","call_no_span","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","compare","compare","conditions","conditions","cost","cost","cost","default","default","default","desugar","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fold","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_str","get_var","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","head","head","head","ident","ignore_viz","ignore_viz","input","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","is_global_ref","is_var","lhs","lhs","lit_no_span","lit_no_span","load","map_def_use","map_exprs","merge","merge","merge_action","merge_action","name","name","name","name","new","new","new","new","output","output_type","parse","partial_cmp","partial_cmp","relation","relation","rhs","rhs","ruleset","ruleset","schema","schema","singleton","sort","sort","span","span","span","span","span","span","span","span","store","subst","subst","subst_leaf","to","to_command","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_sexp","to_sexp","to_sexp","to_sexp","to_sexp","to_sexp","to_sexp","to_sexp","to_sexp","to_sexp","to_sexp","to_sexp","to_sexp","to_sexp","to_sexp","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","types","unextractable","unextractable","until","until","var_no_span","var_no_span","vars","visit_exprs","visit_exprs","visit_exprs","visit_exprs","visit_exprs","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","walk","constructor","datatypes","expr","expr","exprs","file","file","inputs","name","name","name","name","rule","ruleset","schedule","span","span","span","span","span","span","span","value","variants","variants","constructor","datatypes","expr","expr","exprs","file","file","inputs","name","name","name","name","rule","ruleset","schedule","span","span","span","span","span","span","span","value","variants","variants","exprs","file","file","name","name","name","rule","ruleset","span","span","value","exprs","file","file","name","name","name","rule","ruleset","span","span","value","Bool","DUMMY_SPAN","EndOfFile","EqFactLt2","Float","Ident","Int","MissingEndQuote","ParseError","Span","String","Text","Uint","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","deref","eq","equivalent","equivalent","fmt","fmt","fmt","fmt","from","from","from","hash","into","into","into","parse_expr","parse_program","string","to_owned","to_string","to_string","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","AllEqualTypeConstraint","And","ArityMismatch","Assign","Constraint","ConstraintError","Eq","FunctionMismatch","Impossible","ImpossibleCaseIdentified","ImpossibleConstraint","InconsistentConstraint","NoConstraintSatisfied","Problem","SimpleTypeConstraint","TypeConstraint","UnconstrainedVar","Xor","add_actions","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","constraints","default","fmt","fmt","fmt","from","from","from","from","from","from","get","get","get","into","into","into","into","into","into","into_box","into_box","new","new","range","to_owned","to_type_error","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","with_all_arguments_sort","with_exact_length","with_output_sort","actual","actual_input","actual_output","atom","expected","expected_input","expected_output","BigIntSort","BigRatSort","BoolSort","EqSort","F64Sort","FromSort","FunctionSort","I64Sort","IntoSort","MapSort","MultiSetSort","NotEqualPrimitive","PreSort","Presort","RationalSort","SetSort","Sort","Sort","Sort","StringSort","UnitSort","VecSort","apply","apply","as_arc_any","as_arc_any","as_arc_any","as_arc_any","as_arc_any","as_arc_any","as_arc_any","as_arc_any","as_arc_any","as_arc_any","as_arc_any","as_arc_any","as_arc_any","as_arc_any","as_arc_any","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","canonicalize","canonicalize","canonicalize","canonicalize","canonicalize","canonicalize","canonicalize","element","element","element","element_name","element_name","element_name","extract_expr","extract_expr","extract_expr","extract_expr","extract_expr","extract_expr","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","foreach_tracked_values","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","get_type_constraints","inner_values","inner_values","inner_values","inner_values","inner_values","inner_values","inputs","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","is_container_sort","is_container_sort","is_container_sort","is_container_sort","is_container_sort","is_container_sort","is_eq_container_sort","is_eq_container_sort","is_eq_container_sort","is_eq_container_sort","is_eq_container_sort","is_eq_container_sort","is_eq_sort","is_eq_sort","literal_sort","load","make_expr","make_expr","make_expr","make_expr","make_expr","make_expr","make_expr","make_expr","make_expr","make_expr","make_expr","make_expr","make_expr","make_expr","make_expr","make_sort","make_sort","make_sort","make_sort","make_sort","make_sort","name","name","name","name","name","name","name","name","name","name","name","name","name","name","name","name","name","output","presort_name","presort_name","presort_name","presort_name","presort_name","presort_name","register_primitives","register_primitives","register_primitives","register_primitives","register_primitives","register_primitives","register_primitives","register_primitives","register_primitives","register_primitives","register_primitives","register_primitives","register_primitives","register_primitives","reserved_primitives","reserved_primitives","reserved_primitives","reserved_primitives","reserved_primitives","reserved_primitives","serialized_name","serialized_name","serialized_name","serialized_name","serialized_name","store","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","FreshGen","IndexMap","IndexSet","SymbolGen","borrow","borrow_mut","clone","clone_into","eq","equivalent","equivalent","fmt","fresh","fresh","from","has_been_used","into","new","to_owned","try_from","try_into","type_id","vzip"],"q":[[0,"egglog"],[350,"egglog::ExtractReport"],[355,"egglog::SerializedNode"],[357,"egglog::ast"],[978,"egglog::ast::Command"],[1003,"egglog::ast::GenericCommand"],[1028,"egglog::ast::GenericNCommand"],[1039,"egglog::ast::NCommand"],[1050,"egglog::ast::parse"],[1104,"egglog::constraint"],[1191,"egglog::constraint::ImpossibleConstraint"],[1198,"egglog::sort"],[1486,"egglog::util"],[1509,"egglog::typechecking"],[1510,"core::result"],[1511,"core::convert"],[1512,"egglog::termdag"],[1513,"alloc::vec"],[1514,"egglog::value"],[1515,"core::option"],[1516,"egraph_serialize"],[1517,"egglog::function"],[1518,"egglog::serialize"],[1519,"core::cmp"],[1520,"egglog::ast::expr"],[1521,"alloc::string"],[1522,"core::fmt"],[1523,"ordered_float"],[1524,"alloc::sync"],[1525,"core::marker"],[1526,"core::ops::function"],[1527,"alloc::boxed"],[1528,"core::hash"],[1529,"smallvec"],[1530,"core::error"],[1531,"core::any"],[1532,"core::clone"],[1533,"core::iter::traits::collect"],[1534,"core::num::nonzero"],[1535,"generic_symbolic_expressions::sexp"],[1536,"core::iter::traits::iterator"],[1537,"egglog::sort::unit"],[1538,"egglog::sort::fn"],[1539,"egglog::sort::bigint"],[1540,"egglog::sort::bigrat"],[1541,"egglog::sort::bool"],[1542,"egglog::sort::rational"],[1543,"egglog::sort::string"],[1544,"egglog::sort::i64"],[1545,"egglog::sort::f64"],[1546,"egglog::sort::map"],[1547,"egglog::sort::set"],[1548,"egglog::sort::vec"],[1549,"egglog::sort::multiset"]],"i":[12,0,24,30,30,22,0,0,30,0,0,22,30,12,30,30,25,0,30,30,30,0,22,30,0,0,0,0,0,25,0,22,0,30,0,0,0,30,30,0,0,12,24,1,6,1,1,6,1,10,14,19,23,23,0,15,28,19,21,22,12,10,1,15,23,24,7,25,6,37,30,28,19,21,22,12,10,1,15,23,24,7,25,6,37,30,6,21,6,21,22,12,10,1,15,23,24,7,25,6,21,22,12,10,1,15,23,24,7,25,6,15,15,0,1,28,10,1,23,6,7,22,12,10,15,7,25,12,12,10,10,15,15,7,7,25,25,6,6,10,6,6,6,6,6,15,6,21,22,12,10,15,23,23,24,7,25,25,37,37,30,30,28,19,21,22,12,10,1,15,15,15,15,15,23,24,7,7,25,6,37,30,30,30,6,25,1,6,6,21,10,6,6,6,6,1,6,1,14,19,1,12,15,7,25,28,21,21,28,19,21,22,12,10,1,15,23,24,7,25,6,37,30,21,6,22,10,10,1,0,28,28,21,14,19,23,6,6,15,6,1,1,6,6,6,21,6,6,23,1,28,6,6,21,23,23,6,6,6,10,0,1,30,21,15,10,6,21,22,12,10,1,15,23,24,7,25,6,10,23,25,37,30,28,19,21,22,12,10,1,15,23,24,7,25,6,37,30,28,19,21,22,12,10,1,15,23,24,7,25,6,37,30,28,19,21,22,12,10,1,15,23,24,7,25,6,37,30,23,6,15,23,0,6,10,28,19,21,22,12,10,1,15,23,24,7,25,6,37,30,122,122,122,123,123,124,124,0,56,72,0,125,56,68,72,56,72,31,27,32,0,126,81,125,56,68,72,0,125,68,0,56,72,56,72,80,127,78,0,126,81,126,81,31,0,127,78,0,125,56,68,72,125,56,68,72,0,0,0,0,0,0,0,0,0,0,0,0,0,56,72,125,56,68,72,31,126,81,27,32,0,0,71,125,68,125,56,68,72,126,81,125,56,68,72,56,72,125,56,68,72,125,56,68,72,125,68,125,56,68,72,56,72,56,72,128,70,0,0,56,72,0,56,72,128,70,0,125,56,68,72,128,70,0,0,128,70,126,81,125,56,68,72,56,72,125,56,68,72,31,0,0,80,0,0,126,81,31,125,56,68,72,27,32,0,71,11,32,129,83,11,130,31,67,32,68,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,11,130,31,67,32,68,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,27,32,11,31,67,32,68,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,11,31,67,32,68,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,11,31,11,31,131,84,91,75,76,82,91,75,0,11,31,67,32,68,70,71,73,74,75,76,77,78,79,80,81,82,83,11,11,31,31,67,67,32,32,68,68,70,70,71,71,73,73,74,74,75,75,76,76,77,77,78,78,79,79,80,80,81,81,82,82,83,83,11,11,31,31,67,67,32,32,68,68,70,70,71,72,72,73,73,74,75,76,77,78,78,79,79,80,81,81,82,83,83,84,84,32,11,11,11,11,11,11,130,31,31,31,31,67,32,68,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,11,32,11,31,67,32,68,70,73,74,75,76,77,78,79,80,81,82,83,129,79,83,73,91,75,77,11,130,31,67,32,68,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,67,32,131,84,27,32,11,81,81,91,75,91,75,91,67,75,76,11,77,79,82,77,32,0,11,31,91,75,131,84,132,74,91,75,82,67,73,32,91,129,131,75,76,83,84,11,32,81,32,79,68,11,31,67,32,68,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,87,11,67,32,70,72,73,74,75,76,77,78,81,83,84,11,31,67,32,68,70,72,73,78,79,81,83,84,11,130,31,67,32,68,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,11,130,31,67,32,68,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,11,130,31,67,32,68,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,76,91,75,132,74,27,32,32,32,68,74,75,81,11,130,31,67,32,68,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,32,133,134,135,136,137,138,137,133,139,140,141,138,141,141,135,140,134,133,135,136,138,137,139,140,136,133,134,135,136,137,138,137,133,139,140,141,138,141,141,135,140,134,133,135,136,138,137,139,140,136,142,142,143,144,145,143,145,145,142,143,144,142,142,143,144,145,143,145,145,142,143,144,41,0,41,41,41,41,41,41,0,0,41,41,41,3,94,41,3,94,41,3,3,94,3,3,3,3,3,41,41,3,94,41,3,3,94,41,0,0,3,3,3,41,3,94,41,3,94,41,3,94,41,3,94,41,0,98,97,98,0,0,98,97,98,101,0,101,101,0,0,0,101,98,95,101,99,100,97,98,95,101,99,100,97,98,95,97,97,95,95,97,98,95,101,99,100,97,98,95,50,99,100,101,99,100,97,98,95,99,100,99,100,95,97,101,101,99,100,97,98,95,101,99,100,97,98,95,101,99,100,97,98,95,101,99,100,97,98,95,100,100,100,146,147,147,146,146,147,147,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,119,120,0,0,0,102,103,9,105,106,107,108,109,110,111,112,113,114,115,103,116,117,102,105,106,107,108,109,110,111,112,113,114,115,103,116,117,102,105,106,107,108,109,110,111,112,113,114,115,103,116,117,9,113,114,115,103,116,117,114,115,116,114,115,116,9,113,114,115,103,116,105,106,107,108,109,110,111,112,113,114,115,103,116,117,9,102,105,106,107,108,109,110,111,112,113,114,115,103,116,117,102,9,113,114,115,103,116,103,102,105,106,107,108,109,110,111,112,113,114,115,103,116,117,9,113,114,115,103,116,9,113,114,115,103,116,9,117,0,119,9,105,106,107,108,109,110,111,112,113,114,115,103,116,117,148,113,114,115,103,116,9,102,105,106,107,108,109,110,111,112,113,114,115,103,116,117,117,103,148,113,114,115,103,116,9,105,106,107,108,109,110,111,112,113,114,115,103,116,148,113,114,115,103,116,9,114,115,103,116,120,102,105,106,107,108,109,110,111,112,113,114,115,103,116,117,102,105,106,107,108,109,110,111,112,113,114,115,103,116,117,102,105,106,107,108,109,110,111,112,113,114,115,103,116,117,102,105,106,107,108,109,110,111,112,113,114,115,103,116,117,0,0,0,0,96,96,96,96,96,96,96,96,121,96,96,96,96,96,96,96,96,96,96],"f":"```````````````````````````````````````````{{bdf}{{j{h`}}}}{{ld}{{j{h`}}}}{{bf}{{j{h`}}}}{{bc}h{{A`{n}}}}{{lc}h{{A`{n}}}}{{bcf}{{j{h`}}}Ab}{{AdAf{Aj{Ah}}}Ah}{{Al{B`{An}}{Bb{{B`{d}}d}}{Bd{l}}}{{Bd{An}}}}{{Bf{B`{An}}{Bb{{B`{d}}d}}{Bd{l}}}{{Bd{An}}}}````{ce{}{}}00000000000000000000000000000{{lBh}An}{Bjh}{lh}{BjBj}{BlBl}{AhAh}{AdAd}{bb}{AnAn}{BnBn}{C`C`}{nn}{CbCb}{ll}{{ce}h{}{}}0000000000{{AnAn}Cd}{{ce}Cd{}{}}`{{bc{Bd{{Bb{Af{Aj{Cf}}}}}}f}{{j{h`}}}{{A`{Af}}}}{{}Ch}{{}Ad}{{}b}{{}Bn}{{}l}{nc{}}{{BlBl}Cj}{{AhAh}Cj}{{AdAd}Cj}{{AnAn}Cj}{{nn}Cj}{{CbCb}Cj}{{ce}Cj{}{}}000000000{{lCf}{{j{{Bb{dAn}}Cl}}}}{{lCn}An}{{Ad{D`{AfAf}}}Ah}{{lAnAdd}{{Bb{DbAh}}}}{{ldAn}{{Bb{AdAh}}}}{{ldAn}Dd}{{ldAnDbAd}{{Aj{Ah}}}}`{{}An}{{ldAn}An}{{BjDf}Dh}{{BlDf}Dh}{{AhDf}Dh}{{AdDf}Dh}{{AnDf}Dh}{{BnDf}Dh}0{{C`Df}Dh}{{nDf}Dh}{{CbDf}Dh}0{{DjDf}Dh}0{{ClDf}Dh}0{cc{}}000000{DlAn}{AfAn}{CjAn}{{{E`{Dn}}}An}4444{cnAl}555{DjCl}6{EbCl}{{lEd}Bl}{Ef{{j{Cbc}}}{}}`{{lAfDb}{{j{{Bb{{Aj{{Bb{AhAh}}}}Ad}}Cl}}}}`{{Bj{B`{An}}}{{Bd{An}}}}{{AdEh}Ah}{l{{Bd{C`}}}}{lBn}{l{{Bd{Bn}}}}{l{{Bd{{Ej{c}}}}}{AbElEn}}{{be}{{Bd{{Ej{c}}}}}{AbElEn}{{Fb{{Ej{c}}}{{F`{Cj}}}}}}{{le}{{Bd{{Ej{c}}}}}{AbElEn}{{Fb{{Ej{c}}}{{F`{Cj}}}}}}{b{{Ej{c}}}{AbElEn}}{{Alf}{{Ff{Fd}}}}{{Bff}{{Ff{Fd}}}}`{{Ahc}hFh}{{Anc}hFh}{{nc}hFh}{{Cbc}hFh}`{{Bj{B`{An}}AnFj}{{Bd{An}}}}{{Bj{B`{An}}AnFjCj}{{Bd{An}}}}{ce{}{}}00000000000000{BjCj}{lCj}{BlCj}{{AdCn}Ah}{{AdAh}Eh}{{bAf}{{Bd{d}}}}````{AlAf}{BfAf}`{lDb}{{l{Bd{Dd}}Ef}{{j{{Aj{Dd}}Cl}}}}{{AnAn}{{Bd{Cd}}}}{l{{j{hCl}}}}``{{lAfDb}{{j{hCl}}}}{{l{Bd{Af}}}{{j{hCl}}}}{lh}`{l{{j{DbCl}}}}7````{{l{Aj{G`}}}{{j{{Aj{Dd}}Cl}}}}````{{lCh}Gb}{{lAf}h}{AdDb}``{Cl{{Bd{Gd}}}}{{Bj{B`{An}}}h}`{{AdAh}Cf}{{l{Bd{d}}Bl}Ed}{ce{}{}}0000000000{{AdAh}Dd}{cDd{}}000{c{{j{e}}}{}{}}00000000000000000000000000000{cGf{}}00000000000000{{BnBn}Bn}{{lGhGhAf}Gh}{{}An}``{{ldAn}Bh}{{AdAf}Ah}999999999999999``````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````{AfEf}{{{D`{ce}}}Db{GjGl}{GnGjGlH`}}``;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;{{ce}Cf{{A`{Af}}}{{Hd{}{{Hb{Cf}}}}}}{{ce}{{D`{AfAf}}}{{A`{Af}}}{{Hd{}{{Hb{{D`{AfAf}}}}}}}}{AfAf}{CnCn}{HfHf}{{{D`{ce}}}{{D`{ce}}}GjGj}{{{Hh{ce}}}{{Hh{ce}}}{GjGlGj}{GjHjH`GlGnGj}}{{{Hl{ce}}}{{Hl{ce}}}GjGj}{HnHn}{{{I`{ce}}}{{I`{ce}}}{GjGlGj}{GjHjH`GlGnGj}}{IbIb}{{{Id{ce}}}{{Id{ce}}}GjGj}{{{If{ce}}}{{If{ce}}}{GjGlGj}{GjHjH`GlGnGj}}{IhIh}{IjIj}{{{Il{ce}}}{{Il{ce}}}GjGj}{{{In{ce}}}{{In{ce}}}{GjGlGj}{GjHjH`GlGnGj}}{J`J`}{{{Jb{ce}}}{{Jb{ce}}}{GjGlGj}{GjHjH`GlGnGj}}{{{Jd{ce}}}{{Jd{ce}}}{GjGjGl}{GjGjHjH`GlGn}}{{{Jf{ce}}}{{Jf{ce}}}{GjGlGj}{GjHjH`GlGnGj}}{{{Jh{ce}}}{{Jh{ce}}}GjGj}{{ce}h{}{}}0000000000000000000{{AfAf}Cd}{{CnCn}Cd}{{ce}Cd{}{}}0`````{{}{{Jd{ce}}}{GjGl}{GjHjH`GlGn}}```{{AfAf}Cj}{{CnCn}Cj}{{HfHf}Cj}{{{D`{ce}}{D`{ce}}}CjHjHj}{{{Hh{ce}}{Hh{ce}}}Cj{GjGlHj}{GjHjH`GlGnHj}}{{{Hl{ce}}{Hl{ce}}}CjHjHj}{{HnHn}Cj}{{IbIb}Cj}{{{Id{ce}}{Id{ce}}}CjHjHj}{{{If{ce}}{If{ce}}}Cj{GjGlHj}{GjHjH`GlGnHj}}{{IhIh}Cj}{{IjIj}Cj}{{{Il{ce}}{Il{ce}}}CjHjHj}{{{In{ce}}{In{ce}}}Cj{GjGlHj}{GjHjH`GlGnHj}}{{J`J`}Cj}{{{Jb{ce}}{Jb{ce}}}Cj{GjGlHj}{GjHjH`GlGnHj}}{{{Jd{ce}}{Jd{ce}}}Cj{HjGjGl}{HjGjHjH`GlGn}}{{{Jf{ce}}{Jf{ce}}}Cj{GjGlHj}{GjHjH`GlGnHj}}{{ce}Cj{}{}}00000000000000000000000000000000000{{AfDf}{{j{hJj}}}}0{{CnDf}Dh}0{{HfDf}Dh}0{{{D`{ce}}Df}DhJlJl}{{{D`{ce}}Df}DhGlGl}{{{Hh{ce}}Df}Dh{GjGlJl}{GjHjH`GlGnJl}}{{{Hh{ce}}Df}Dh{GjGlJn}{GjHjH`GlGnJn}}{{{Hl{ce}}Df}DhJlJl}{{{Hl{ce}}Df}DhGlGl}{{HnDf}Dh}{{{I`{ce}}Df}Dh{GjGlJl}{GjHjH`GlGnJl}}{{{I`{ce}}Df}Dh{GjGlJn}{GjHjH`GlGnJn}}{{IbDf}Dh}0{{{Id{ce}}Df}DhJlJl}{{{If{ce}}Df}Dh{GjGlJl}{GjHjH`GlGnJl}}{{IhDf}Dh}{{IjDf}Dh}{{{Il{ce}}Df}DhJlJl}{{{Il{ce}}Df}DhGlGl}{{{In{ce}}Df}Dh{GjGlJl}{GjHjH`GlGnJl}}{{{In{ce}}Df}Dh{GjGl}{GjHjH`GlGn}}{{J`Df}Dh}{{{Jb{ce}}Df}Dh{GjGlJn}{GjHjH`GlGnJn}}{{{Jb{ce}}Df}Dh{GjGlJl}{GjHjH`GlGnJl}}{{{Jd{ce}}Df}Dh{JlGjGl}{JlGjHjH`GlGn}}{{{Jf{ce}}Df}Dh{GjGlJn}{GjHjH`GlGnJn}}{{{Jf{ce}}Df}Dh{GjGlJl}{GjHjH`GlGnJl}}{{{Jh{ce}}Df}DhJlJl}{{{Jh{ce}}Df}DhGlGl}{{{D`{ce}}i}g{GjGl}{GnGjGlH`}{}{{K`{{D`{ce}}{Aj{g}}}{{F`{g}}}}}}{CnAf}{{{Kb{Fj}}}Af}{DdAf}{cc{}}{EfAf}21{AfCn}{{{E`{Dn}}}Cn}3{DlCn}444444444444444444{Ef{{j{Af}}}}{{{D`{ce}}}{{Bd{e}}}{GjGl}{GnGjGlH`}}{{Afc}hFh}{{Cnc}hFh}{{Hfc}hFh}{{{D`{ce}}g}hGnGnFh}{{{Hh{ce}}g}h{GjGlGn}{GjHjH`GlGnGn}Fh}{{{Hl{ce}}g}hGnGnFh}{{Ibc}hFh}{{{Id{ce}}g}hGnGnFh}{{{If{ce}}g}h{GjGlGn}{GjHjH`GlGnGn}Fh}{{Ihc}hFh}{{Ijc}hFh}{{{Il{ce}}g}hGnGnFh}{{{In{ce}}g}h{GjGlGn}{GjHjH`GlGnGn}Fh}{{J`c}hFh}{{{Jb{ce}}g}h{GjGlGn}{GjHjH`GlGnGn}Fh}{{{Jd{ce}}g}h{GnGjGl}{GnGjHjH`GlGn}Fh}{{{Jf{ce}}g}h{GjGlGn}{GjHjH`GlGnGn}Fh}```````{ce{}{}}00000000000000000000`{{{D`{ce}}}Cj{GjGl}{GnGjGlH`}}``{cCf{{A`{Cn}}}}{c{{D`{AfAf}}}{{A`{Cn}}}}{{cAn}Af{}}{{{Jb{ce}}g}{{Jb{ce}}}{GjGl}{GjH`GlGn}{{K`{eCj}{{F`{e}}}}}}{{{Jb{ce}}g}{{Jb{ce}}}{GjGl}{GjH`GlGn}{{K`{{D`{ce}}}{{F`{{D`{ce}}}}}}}}````````{cAf{{Kd{Ef}}}}{{{Aj{Af}}Af}Ij}{{ce}{{In{ce}}}{GjGl}{GjHjH`GlGn}}{{{Aj{{Jb{ce}}}}}{{Jd{ce}}}{GjGl}{GjHjH`GlGn}}`{{{D`{`Hf}}}d}`{{AfAf}{{Bd{Cd}}}}{{CnCn}{{Bd{Cd}}}}{{fAf{Aj{Af}}}Kf}{{fAf{Aj{Af}}}{{If{AfAf}}}}``````{{{Jb{ce}}}{{Jd{ce}}}{GjGl}{GjHjH`GlGn}}``{{{D`{ce}}}f{GjGl}{GnGjGlH`}}```````{{Afc}{{Bd{An}}}{}}{{{D`{ce}}km}{{D`{gi}}}{GjGl}{GnGjGlH`}{}{}{{K`{fe}{{F`{{D`{gi}}}}}}}{{K`{c}{{F`{g}}}}}}{{{Jb{ce}}g}{{Jb{ce}}}{GjGl}{GjH`GlGn}{{K`{fe}{{F`{{D`{ce}}}}}}}}{{{D`{ce}}i}{{D`{cg}}}{GjGl}{GnGjGlH`}{}{{K`{fe}{{F`{{D`{cg}}}}}}}}`{{{Hh{ce}}}{{I`{ce}}}{GjGl}{GjHjH`GlGn}}{ce{}{}}0000000000000000000{JnKh}{AfKh}{HfKh}{{{D`{ce}}}KhGlGl}{{{Hl{ce}}}KhGlGl}{{{I`{ce}}}Kh{GjGlJn}{GjHjH`GlGnJn}}{IbKh}{{{Id{ce}}}KhGlGl}{{{If{ce}}}Kh{GjGlJn}{GjHjH`GlGnJn}}{IhKh}{IjKh}{{{Il{ce}}}KhGlGl}{{{Jb{ce}}}Kh{GjGlJn}{GjHjH`GlGnJn}}{{{Jf{ce}}AfAf}Kh{GjGlJn}{GjHjH`GlGnJn}}{{{Jh{ce}}AfCjCj}KhGlGl}{cDd{}}000000000000{c{{j{e}}}{}{}}00000000000000000000000000000000000000000{cGf{}}00000000000000000000`````{cCf{{A`{Af}}}}{c{{D`{AfAf}}}{{A`{Af}}}}{{{D`{ce}}}{{`{{Kj{}{{Hb{e}}}}}}}{GjGl}{GnGjGlH`}}{{{D`{ce}}g}{{D`{ce}}}{GjGl}{GnGjGlH`}{{K`{{D`{ce}}}{{F`{{D`{ce}}}}}}}}{{{Hh{ce}}g}{{Hh{ce}}}{GjGl}{GjHjH`GlGn}{{K`{{D`{ce}}}{{F`{{D`{ce}}}}}}}}{{{Id{ce}}g}{{Id{ce}}}{GjGl}{GjHjH`GlGn}{{K`{{D`{ce}}}{{F`{{D`{ce}}}}}}}}{{{If{ce}}g}{{If{ce}}}{GjGl}{GjHjH`GlGn}{{K`{{D`{ce}}}{{F`{{D`{ce}}}}}}}}{{{Jb{ce}}g}{{Jb{ce}}}{GjGl}{GjH`GlGn}{{K`{{D`{ce}}}{{F`{{D`{ce}}}}}}}}{ce{}{}}00000000000000000000{{{D`{ce}}gi}h{GjGl}{GnGjGlH`}{{K`{{D`{ce}}}}}{{K`{{D`{ce}}}}}}`````````````````````````````````````````````````````````````````````````````````````111111{ff}{{ce}h{}{}}{Klf}{{ff}Cj}{{ce}Cj{}{}}0{{fDf}Dh}0{{EbDf}Dh}0{cc{}}00{{fc}hFh}:::{{{Bd{Dd}}Ef}{{j{CfEb}}}}{{{Bd{Dd}}Ef}{{j{{Aj{G`}}Eb}}}}{fEf}={cDd{}}0{c{{j{e}}}{}{}}00000{cGf{}}00{ce{}{}}00``````````````````{{{Kn{{`{Af}}d}}{`{AfAf}}bL`}{{j{h`}}}}111111111111{LbLb}{{ce}h{}{}}`{{}{{Kn{{`{Af}}d}}}}{{LbDf}Dh}{{{Ld{ce}}Df}DhJlJl}{{{Kn{ce}}Df}DhJlJl}??????{{Fd{B`{{`{Af}}}}b}{{Aj{{Ld{{`{Af}}d}}}}}}{{Lf{B`{{`{Af}}}}b}{{Aj{{Ld{{`{Af}}d}}}}}}{{Lh{B`{{`{Af}}}}b}{{Aj{{Ld{{`{Af}}d}}}}}}::::::{Lf{{Ff{Fd}}}}{Lh{{Ff{Fd}}}}{{Af{Aj{d}}f}Lf}{{Aff}Lh}`>`{c{{j{e}}}{}{}}00000000000{cGf{}}00000{ce{}{}}00000{{Lhd}Lh}{{LhDb}Lh}1`````````````````````````````{{Ll{B`{An}}{Bb{{B`{d}}d}}{Bd{l}}}{{Bd{An}}}}{{LnAn{B`{An}}l}An}{{{Ej{Ab}}}{{Ej{M`}}}}{{{Ej{Mb}}}{{Ej{M`}}}}{{{Ej{Md}}}{{Ej{M`}}}}{{{Ej{Mf}}}{{Ej{M`}}}}{{{Ej{Mh}}}{{Ej{M`}}}}{{{Ej{Mj}}}{{Ej{M`}}}}{{{Ej{Ml}}}{{Ej{M`}}}}{{{Ej{Mn}}}{{Ej{M`}}}}{{{Ej{N`}}}{{Ej{M`}}}}{{{Ej{Nb}}}{{Ej{M`}}}}{{{Ej{Nd}}}{{Ej{M`}}}}{{{Ej{Nf}}}{{Ej{M`}}}}{{{Ej{Ln}}}{{Ej{M`}}}}{{{Ej{Nh}}}{{Ej{M`}}}}{{{Ej{Nj}}}{{Ej{M`}}}}{ce{}{}}00000000000000000000000000000```````{Ndd}{Nfd}{Nhd}{NdAf}{NfAf}{NhAf}``````{{MbDf}Dh}{{MdDf}Dh}{{MfDf}Dh}{{MhDf}Dh}{{MjDf}Dh}{{MlDf}Dh}{{MnDf}Dh}{{N`Df}Dh}{{NbDf}Dh}{{NdDf}Dh}{{NfDf}Dh}{{LnDf}Dh}{{NhDf}Dh}{{NjDf}Dh}{{AbAn{Ff{K`}}}h}{cc{}}00000000000000{{Llf}{{Ff{Fd}}}}{{AbAn}{{Aj{{Bb{dAn}}}}}}{{NbAn}{{Aj{{Bb{dAn}}}}}}{{NdAn}{{Aj{{Bb{dAn}}}}}}{{NfAn}{{Aj{{Bb{dAn}}}}}}{{LnAn}{{Aj{{Bb{dAn}}}}}}{{NhAn}{{Aj{{Bb{dAn}}}}}}`{ce{}{}}00000000000000{AbCj}{NbCj}{NdCj}{NfCj}{LnCj}{NhCj}5432105{NjCj}{Cnd}{{cAn}{{Nn{}{{Nl{c}}}}}Ab}{{AblAn}{{Bb{DbCf}}}}{{MblAn}{{Bb{DbCf}}}}{{MdlAn}{{Bb{DbCf}}}}{{MflAn}{{Bb{DbCf}}}}{{MhlAn}{{Bb{DbCf}}}}{{MjlAn}{{Bb{DbCf}}}}{{MllAn}{{Bb{DbCf}}}}{{MnlAn}{{Bb{DbCf}}}}{{N`lAn}{{Bb{DbCf}}}}{{NblAn}{{Bb{DbCf}}}}{{NdlAn}{{Bb{DbCf}}}}{{NflAn}{{Bb{DbCf}}}}{{LnlAn}{{Bb{DbCf}}}}{{NhlAn}{{Bb{DbCf}}}}{{NjlAn}{{Bb{DbCf}}}}{{bAf{B`{Cf}}}{{j{d`}}}}00000{AbAf}{LlAf}{MbAf}{MdAf}{MfAf}{MhAf}{MjAf}{MlAf}{MnAf}{N`Af}{NbAf}{NdAf}{NfAf}{LnAf}{NhAf}{NjAf}``{{}Af}00000{{{Ej{Ab}}b}h}{{{Ej{Mb}}b}h}{{{Ej{Md}}b}h}{{{Ej{Mf}}b}h}{{{Ej{Mh}}b}h}{{{Ej{Mj}}b}h}{{{Ej{Ml}}b}h}{{{Ej{Mn}}b}h}{{{Ej{N`}}b}h}{{{Ej{Nb}}b}h}{{{Ej{Nd}}b}h}{{{Ej{Nf}}b}h}{{{Ej{Ln}}b}h}{{{Ej{Nh}}b}h}{{}{{Aj{Af}}}}00000{{AbAn}Af}{{NdAn}Af}{{NfAn}Af}{{LnAn}Af}{{NhAn}Af}{{{O`{}{{Nl{c}}}}c}{{Bd{An}}}Ab}{c{{j{e}}}{}{}}00000000000000000000000000000{cGf{}}00000000000000{ce{}{}}00000000000000````00{L`L`}{{ce}h{}{}}{{L`L`}Cj}{{ce}Cj{}{}}0{{L`Df}Dh}{{Obc}e{}{}}{{L`Af}Af}{cc{}}{L`Cj}9{DdL`}:<<;:","D":"B@d","p":[[5,"TypeInfo",0,1509],[8,"ArcSort",0],[5,"Span",1050],[1,"unit"],[6,"Result",1510],[5,"EGraph",0],[5,"Primitive",0],[10,"Into",1511],[10,"Sort",1198],[5,"TermDag",0,1512],[5,"Symbol",357],[6,"Term",0,1512],[5,"Vec",1513],[10,"PrimitiveLike",0],[5,"Value",0,1514],[1,"slice"],[1,"tuple"],[6,"Option",1515],[5,"SimplePrimitive",0],[5,"ClassId",1516],[5,"Function",0,1517],[6,"SerializedNode",0,1518],[5,"RunReport",0],[6,"ExtractReport",0],[6,"RunMode",0],[6,"Ordering",1519],[8,"Expr",357,1520],[5,"SerializeConfig",0,1518],[1,"bool"],[6,"Error",0],[6,"Literal",357,1520],[6,"GenericExpr",357,1520],[1,"usize"],[5,"String",1521],[5,"Formatter",1522],[8,"Result",1522],[5,"NotFoundError",0],[1,"i64"],[1,"f64"],[5,"OrderedFloat",1523],[6,"ParseError",1050],[5,"NodeId",1516],[1,"str"],[8,"TermId",0,1512],[5,"Arc",1524],[10,"Send",1525],[10,"Sync",1525],[17,"Output"],[10,"Fn",1526],[10,"TypeConstraint",1104],[5,"Box",1527],[10,"Hasher",1528],[1,"u32"],[1,"array"],[5,"SmallVec",1529],[8,"Command",357],[5,"EGraph",1516],[10,"Error",1530],[5,"TypeId",1531],[1,"u64"],[10,"Clone",1532],[10,"Display",1522],[10,"Hash",1528],[10,"Eq",1519],[17,"Item"],[10,"IntoIterator",1533],[5,"ResolvedVar",357,1520],[6,"GenericNCommand",357],[10,"PartialEq",1519],[6,"GenericSchedule",357],[6,"Subdatatypes",357],[6,"GenericCommand",357],[5,"IdentSort",357],[5,"GenericRunConfig",357],[5,"GenericFunctionDecl",357],[5,"Variant",357],[5,"Schema",357],[6,"GenericFact",357],[5,"CorrespondingVar",357],[6,"Change",357],[6,"GenericAction",357],[5,"GenericActions",357],[5,"GenericRule",357],[5,"GenericRewrite",357],[5,"Error",1522],[10,"Debug",1522],[10,"ToSexp",357],[10,"FnMut",1526],[5,"NonZero",1534],[10,"AsRef",1511],[8,"FunctionDecl",357],[6,"Sexp",1535],[10,"Iterator",1536],[5,"DUMMY_SPAN",1050],[5,"Problem",1104],[5,"SymbolGen",1486],[6,"ImpossibleConstraint",1104],[6,"Constraint",1104],[5,"SimpleTypeConstraint",1104],[5,"AllEqualTypeConstraint",1104],[6,"ConstraintError",1104],[5,"NotEqualPrimitive",1198,1537],[5,"FunctionSort",1198,1538],[10,"Any",1531],[5,"BigIntSort",1198,1539],[5,"BigRatSort",1198,1540],[5,"BoolSort",1198,1541],[5,"RationalSort",1198,1542],[5,"StringSort",1198,1543],[5,"UnitSort",1198,1537],[5,"I64Sort",1198,1544],[5,"F64Sort",1198,1545],[5,"MapSort",1198,1546],[5,"SetSort",1198,1547],[5,"VecSort",1198,1548],[5,"MultiSetSort",1198,1549],[5,"EqSort",1198],[17,"Sort"],[10,"FromSort",1198],[10,"IntoSort",1198],[10,"FreshGen",1486],[15,"Best",350],[15,"Variants",350],[15,"Function",355],[8,"NCommand",357],[8,"Action",357],[8,"Fact",357],[8,"Schedule",357],[8,"Rule",357],[5,"Facts",357],[8,"Rewrite",357],[8,"RunConfig",357],[15,"Relation",1003],[15,"Datatypes",1003],[15,"Simplify",1003],[15,"QueryExtract",1003],[15,"Output",1003],[15,"Input",1003],[15,"SetOption",1003],[15,"Datatype",1003],[15,"Rule",1003],[15,"Output",1028],[15,"Input",1028],[15,"SetOption",1028],[15,"NormRule",1028],[15,"ArityMismatch",1191],[15,"FunctionMismatch",1191],[10,"Presort",1198]],"r":[[10,1517],[27,1518],[28,1518],[34,1512],[35,1512],[36,1512],[39,1509],[40,1514],[388,1520],[410,1520],[430,1520],[467,1520],[1198,1539],[1199,1540],[1200,1541],[1202,1545],[1204,1538],[1205,1544],[1207,1546],[1208,1549],[1209,1537],[1212,1542],[1213,1547],[1217,1543],[1218,1537],[1219,1548]],"b":[[152,"impl-Debug-for-RunReport"],[153,"impl-Display-for-RunReport"],[156,"impl-Debug-for-RunMode"],[157,"impl-Display-for-RunMode"],[158,"impl-Display-for-NotFoundError"],[159,"impl-Debug-for-NotFoundError"],[160,"impl-Display-for-Error"],[161,"impl-Debug-for-Error"],[169,"impl-From%3Ci64%3E-for-Value"],[170,"impl-From%3CGlobalSymbol%3E-for-Value"],[171,"impl-From%3Cbool%3E-for-Value"],[172,"impl-From%3COrderedFloat%3Cf64%3E%3E-for-Value"],[181,"impl-From%3CNotFoundError%3E-for-Error"],[183,"impl-From%3CParseError%3E-for-Error"],[671,"impl-Display-for-GlobalSymbol"],[672,"impl-Debug-for-GlobalSymbol"],[673,"impl-Debug-for-Literal"],[674,"impl-Display-for-Literal"],[675,"impl-Display-for-ResolvedVar"],[676,"impl-Debug-for-ResolvedVar"],[677,"impl-Debug-for-GenericExpr%3CHead,+Leaf%3E"],[678,"impl-Display-for-GenericExpr%3CHead,+Leaf%3E"],[679,"impl-Debug-for-GenericNCommand%3CHead,+Leaf%3E"],[680,"impl-Display-for-GenericNCommand%3CHead,+Leaf%3E"],[681,"impl-Debug-for-GenericSchedule%3CHead,+Leaf%3E"],[682,"impl-Display-for-GenericSchedule%3CHead,+Leaf%3E"],[684,"impl-Debug-for-GenericCommand%3CHead,+Leaf%3E"],[685,"impl-Display-for-GenericCommand%3CHead,+Leaf%3E"],[686,"impl-Debug-for-IdentSort"],[687,"impl-Display-for-IdentSort"],[692,"impl-Debug-for-GenericFact%3CHead,+Leaf%3E"],[693,"impl-Display-for-GenericFact%3CHead,+Leaf%3E"],[694,"impl-Debug-for-CorrespondingVar%3CHead,+Leaf%3E"],[695,"impl-Display-for-CorrespondingVar%3CHead,+Leaf%3E"],[697,"impl-Display-for-GenericAction%3CHead,+Leaf%3E"],[698,"impl-Debug-for-GenericAction%3CHead,+Leaf%3E"],[700,"impl-Display-for-GenericRule%3CHead,+Leaf%3E"],[701,"impl-Debug-for-GenericRule%3CHead,+Leaf%3E"],[702,"impl-Debug-for-GenericRewrite%3CHead,+Leaf%3E"],[703,"impl-Display-for-GenericRewrite%3CHead,+Leaf%3E"],[705,"impl-From%3CLiteral%3E-for-GlobalSymbol"],[706,"impl-From%3CNonZero%3Cu32%3E%3E-for-GlobalSymbol"],[707,"impl-From%3C%26String%3E-for-GlobalSymbol"],[709,"impl-From%3C%26str%3E-for-GlobalSymbol"],[710,"impl-From%3CString%3E-for-GlobalSymbol"],[712,"impl-From%3CGlobalSymbol%3E-for-Literal"],[713,"impl-From%3COrderedFloat%3Cf64%3E%3E-for-Literal"],[715,"impl-From%3Ci64%3E-for-Literal"],[1075,"impl-Display-for-Span"],[1076,"impl-Debug-for-Span"],[1077,"impl-Debug-for-ParseError"],[1078,"impl-Display-for-ParseError"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAOMEcAABAAQABwACAAsAAAANAAkAGAACABwAAAAeAAEAIQABACUAAgApAAMALwAAADEAAAAzACMAWAAzAJAAAgCUAA4AqgADALIAAAC2AAAAuAAAALoABADEAAAAxgAAAMgACADgAAEA5QAIAO8AAADxAAsA/gAAAAABAQADAQAABQECAAkBAAAMAQoAGAEzAE0BAABQARMAZgEAAGkBAQBsAQAAcAECAHYBAAB4AQAAegEDAIABAQCFAQIAigEFAJEBAACTAQAAlQEAAJcBAgCbAQAAnwEEAKYBAACoAQAAqgEAAK0BBwC2AQAAuAECALwBAADAAQAAwgEAAMQBAADGAQAAyAECAMwBAADSAQMA2AEGAOABAADiAQUA6gEAAOwBAADuAQIA8gEAAPQBAgD5AQAA/AEBAP8BAAABAgMABgK+AMYCAQDJAgEAzAIAAN8CFgD4AgAADwMPACADBAAmAxUAPQMaAFkDCABkA1MAuQMCAL0DZgAlBBIAOwQAAD8EEQBSBAwAYAQWAH0EAgCGBB4AqAQdAMcEOQACBRMAJQUAACcFBQA8BQ8ATQU/AI4FQADQBQEA0wUJAN4FAADgBQUA"}]\ +]')); +if (typeof exports !== 'undefined') exports.searchIndex = searchIndex; +else if (window.initSearch) window.initSearch(searchIndex); diff --git a/docs/search.desc/egglog/egglog-desc-0-.js b/docs/search.desc/egglog/egglog-desc-0-.js new file mode 100644 index 00000000..131cab99 --- /dev/null +++ b/docs/search.desc/egglog/egglog-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("egglog", 0, "egglog\nA dummy node used to represent omitted nodes.\nA report of the results of an extract action.\nA user defined function call.\nA primitive value.\nRunning a schedule produces a report of the results. This …\nA node in the serialized egraph.\nA node that was split into multiple e-classes.\nLike Exprs but with sharing and deduplication.\nA hashconsing arena for Terms.\nStores resolved typechecking information. TODO make these …\nAdd a user-defined sort\nAdds a sort constructor to the typechecker’s known set …\nAdd a user-defined primitive\nMake and return a Term::App with the given head symbol and …\nGets the value for a serialized class ID.\nRecursively converts the given expression to a term.\nThis example uses EGraph::extract to extract a term. The …\nExtract a value to a TermDag and Term in the TermDag. Note …\nExtract a value to a string for printing. See also …\nfind the leader value for a particular eclass\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nGets the serialized node for the node ID.\nConvert the given id to the corresponding term.\nGets the last extract report and returns it, if the last …\nGets the overall run report and returns it.\nGets the last run report and returns it, if the last …\nReturns a sort based on the type\nReturns the first sort that satisfies the type and …\nConstructs a type constraint for the primitive that uses …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nReturns true if the node is a primitive value.\nMake and return a Term::Lit with the given literal, and …\nConvert the given term to its id.\nTakes a source program input, parses it, runs it, and …\nPop the current egraph off the stack, replacing it with …\nRun a program, represented as an AST. Return a list of …\nThe time it took to run the query, for each rule.\nSerialize the egraph into a format that can be read by the …\nReturns the number of nodes in this DAG.\nMark the given inputs as subsumed.\nRecursively converts the given term to an expression.\nGets the serialized node ID for the primitive, omitted, or …\nConverts the given term to a string.\nIf any changes were made to the database, this is true.\nGets the serialized class ID for a value.\nMake and return a Term::Var with the given symbol, and …\nThe name of the function.\nThe offset of the index in the table. This can be resolved …\nPerform an Action on the global database (see …\nPerform an Action on the global database (see …\nUsing the ruleset command, defines a new ruleset that can …\nUsing the ruleset command, defines a new ruleset that can …\nSimilar to Command::Rewrite, but generates two rules, one …\nSimilar to Command::Rewrite, but generates two rules, one …\nChange a function entry.\nDelete or subsume (mark as hidden from future rewrites …\nDelete or subsume (mark as hidden from future rewrites …\nThe check command checks that the given facts match at …\nThe check command checks that the given facts match at …\nDeclare a user-defined datatype. Datatypes can be unioned …\nDeclare a user-defined datatype. Datatypes can be unioned …\ndelete this entry from a function. Be wary! Only delete …\nMust be at least two things in an eq fact\nMust be at least two things in an eq fact\nextract a datatype from the egraph, choosing the smallest …\nextract a datatype from the egraph, choosing the smallest …\nAssert that a command fails with an error.\nAssert that a command fails with an error.\nDeclare an egglog function, which is a database table with …\nDeclare an egglog function, which is a database table with …\nA Command is the top-level construct in egglog. It …\nFacts are the left-hand side of a Command::Rule. They …\nRepresents the declaration of a function directly parsed …\nA NCommand is a desugared Command, where syntactic sugars …\nInclude another egglog file directly as text and run it.\nInclude another egglog file directly as text and run it.\nInput a CSV file directly into a function.\nInput a CSV file directly into a function.\nBind a variable to a particular datatype or primitive. At …\nBind a variable to a particular datatype or primitive. At …\nExtract and output a set of expressions to a file.\nExtract and output a set of expressions to a file.\npop the current egraph, restoring the previous one. The …\npop the current egraph, restoring the previous one. The …\nPrint out rows a given function, extracting each of the …\nPrint out rows a given function, extracting each of the …\nPrint runtime statistics about rules and rulesets so far.\nPrint runtime statistics about rules and rulesets so far.\nPrint out the number of rows in a function or all …\nPrint out the number of rows in a function or all …\npush the current egraph n times so that it is saved. …\npush the current egraph n times so that it is saved. …\nThe query-extract command runs a query, extracting the …\nThe query-extract command runs a query, extracting the …\nThe relation is syntactic sugar for a named function which …\nThe relation is syntactic sugar for a named function which …\nrewrite is syntactic sugar for a specific form of rule …\nrewrite is syntactic sugar for a specific form of rule …\nRuns a Schedule, which specifies rulesets and the number …\nRuns a Schedule, which specifies rulesets and the number …\nset a function to a particular result. set should not be …\nset a function to a particular result. set should not be …\nEgglog supports several experimental options that can be …\nEgglog supports several experimental options that can be …\nCreate a new user-defined sort, which can then be used in …\nCreate a new user-defined sort, which can then be used in …\nsubsume this entry so that it cannot be queried or …\nA interned string in the global symbol table.\nunion two datatypes, making them equal in the implicit, …\nunion two datatypes, making them equal in the implicit, …\nUsing the combined-ruleset command, construct another …\nUsing the combined-ruleset command, construct another …\nConvert this symbol into the string in the static, global …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nGlobals are desugared to functions, with this flag set to …\nGlobals are desugared to functions, with this flag set to …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nIs this a reference to a global variable? After the …\nIntern a string into the global symbol table.\nParse a string into egglog.\nsubst replaces occurrences of variables and head symbols …\nConverts this expression into a s-expression (symbolic …\nConverts this rule into an s-expression.\nConverts the rewrite into an s-expression.\nApplys f to all sub-expressions (including self) …\nApplys f to all sub-expressions (including self) …\nA Span contains the file name and a pair of offsets …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nThis constraint requires all types to be equivalent to …\nConstruct a set of Assign constraints that fully constrain …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nRequires all arguments to have the given sort. If …\nRequires the length of arguments to be exact_length. Note …\nRequires the output argument to have the given sort.\nApply the function to the values\nFor values like EqSort containers, to make/extract an …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturn the inner values and sorts. Only eq_container_sort …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nExtracting an expression (with smallest cost) out of a …\nReturn the serialized name of the sort\nThis trait lets us statically dispatch between fresh …\nGenerates fresh symbols for internal use during …\nReturns the argument unchanged.\nCalls U::from(self).") \ No newline at end of file diff --git a/docs/settings.html b/docs/settings.html new file mode 100644 index 00000000..bb837b14 --- /dev/null +++ b/docs/settings.html @@ -0,0 +1 @@ +Settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/docs/src-files.js b/docs/src-files.js new file mode 100644 index 00000000..14515467 --- /dev/null +++ b/docs/src-files.js @@ -0,0 +1,4 @@ +var srcIndex = new Map(JSON.parse('[\ +["egglog",["",[["ast",[],["desugar.rs","expr.rs","mod.rs","parse.rs","remove_globals.rs"]],["function",[],["binary_search.rs","index.rs","mod.rs","table.rs"]],["sort",[],["bigint.rs","bigrat.rs","bool.rs","f64.rs","fn.rs","i64.rs","macros.rs","map.rs","mod.rs","multiset.rs","rational.rs","set.rs","string.rs","unit.rs","vec.rs"]]],["actions.rs","constraint.rs","core.rs","extract.rs","gj.rs","lib.rs","serialize.rs","termdag.rs","typechecking.rs","unionfind.rs","util.rs","value.rs"]]]\ +]')); +createSrcSidebar(); diff --git a/docs/src/egglog/actions.rs.html b/docs/src/egglog/actions.rs.html new file mode 100644 index 00000000..f4cea9d1 --- /dev/null +++ b/docs/src/egglog/actions.rs.html @@ -0,0 +1,863 @@ +actions.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+
use crate::core::{
+    GenericCoreAction, GenericCoreActions, ResolvedAtomTerm, ResolvedCoreActions,
+    SpecializedPrimitive,
+};
+use crate::{typechecking::FuncType, *};
+use typechecking::TypeError;
+
+use crate::{ast::Literal, core::ResolvedCall, ExtractReport, Value};
+
+struct ActionCompiler<'a> {
+    types: &'a IndexMap<Symbol, ArcSort>,
+    locals: IndexSet<ResolvedVar>,
+    instructions: Vec<Instruction>,
+}
+
+impl<'a> ActionCompiler<'a> {
+    fn compile_action(&mut self, action: &GenericCoreAction<ResolvedCall, ResolvedVar>) {
+        match action {
+            GenericCoreAction::Let(_ann, v, f, args) => {
+                self.do_call(f, args);
+                self.locals.insert(v.clone());
+            }
+            GenericCoreAction::LetAtomTerm(_ann, v, at) => {
+                self.do_atom_term(at);
+                self.locals.insert(v.clone());
+            }
+            GenericCoreAction::Extract(_ann, e, b) => {
+                let sort = self.do_atom_term(e);
+                self.do_atom_term(b);
+                self.instructions.push(Instruction::Extract(2, sort));
+            }
+            GenericCoreAction::Set(_ann, f, args, e) => {
+                let ResolvedCall::Func(func) = f else {
+                    panic!("Cannot set primitive- should have been caught by typechecking!!!")
+                };
+                for arg in args {
+                    self.do_atom_term(arg);
+                }
+                self.do_atom_term(e);
+                self.instructions.push(Instruction::Set(func.name));
+            }
+            GenericCoreAction::Change(_ann, change, f, args) => {
+                let ResolvedCall::Func(func) = f else {
+                    panic!("Cannot change primitive- should have been caught by typechecking!!!")
+                };
+                for arg in args {
+                    self.do_atom_term(arg);
+                }
+                self.instructions
+                    .push(Instruction::Change(*change, func.name));
+            }
+            GenericCoreAction::Union(_ann, arg1, arg2) => {
+                let sort = self.do_atom_term(arg1);
+                self.do_atom_term(arg2);
+                self.instructions.push(Instruction::Union(2, sort));
+            }
+            GenericCoreAction::Panic(_ann, msg) => {
+                self.instructions.push(Instruction::Panic(msg.clone()));
+            }
+        }
+    }
+
+    fn do_call(&mut self, f: &ResolvedCall, args: &[ResolvedAtomTerm]) {
+        for arg in args {
+            self.do_atom_term(arg);
+        }
+        match f {
+            ResolvedCall::Func(f) => self.do_function(f),
+            ResolvedCall::Primitive(p) => self.do_prim(p),
+        }
+    }
+
+    fn do_atom_term(&mut self, at: &ResolvedAtomTerm) -> ArcSort {
+        match at {
+            ResolvedAtomTerm::Var(_ann, var) => {
+                if let Some((i, ty)) = self.locals.get_full(var) {
+                    self.instructions.push(Instruction::Load(Load::Stack(i)));
+                    ty.sort.clone()
+                } else {
+                    let (i, _, ty) = self.types.get_full(&var.name).unwrap();
+                    self.instructions.push(Instruction::Load(Load::Subst(i)));
+                    ty.clone()
+                }
+            }
+            ResolvedAtomTerm::Literal(_ann, lit) => {
+                self.instructions.push(Instruction::Literal(lit.clone()));
+                crate::sort::literal_sort(lit)
+            }
+            ResolvedAtomTerm::Global(_ann, _var) => {
+                panic!("Global variables should have been desugared");
+            }
+        }
+    }
+
+    fn do_function(&mut self, func_type: &FuncType) {
+        self.instructions.push(Instruction::CallFunction(
+            func_type.name,
+            func_type.has_default || func_type.is_datatype,
+        ));
+    }
+
+    fn do_prim(&mut self, prim: &SpecializedPrimitive) {
+        self.instructions
+            .push(Instruction::CallPrimitive(prim.clone(), prim.input.len()));
+    }
+}
+
+#[derive(Clone, Debug)]
+enum Load {
+    Stack(usize),
+    Subst(usize),
+}
+
+/// The instruction set for the action VM.
+#[derive(Clone, Debug)]
+enum Instruction {
+    /// Push a literal onto the stack.
+    Literal(Literal),
+    /// Push a value from the stack or the substitution onto the stack.
+    Load(Load),
+    /// Pop function arguments off the stack, calls the function,
+    /// and push the result onto the stack. The bool indicates
+    /// whether to make defaults.
+    ///
+    /// This should be set to true after we disallow lookup in rule's actions and :default keyword
+    /// Currently, it's true when has_default() || is_datatype()
+    CallFunction(Symbol, bool),
+    /// Pop primitive arguments off the stack, calls the primitive,
+    /// and push the result onto the stack.
+    CallPrimitive(SpecializedPrimitive, usize),
+    /// Pop function arguments off the stack and either deletes or subsumes the corresponding row
+    /// in the function.
+    Change(Change, Symbol),
+    /// Pop the value to be set and the function arguments off the stack.
+    /// Set the function at the given arguments to the new value.
+    Set(Symbol),
+    /// Union the last `n` values on the stack.
+    Union(usize, ArcSort),
+    /// Extract the best expression. `n` is always 2.
+    /// The first value on the stack is the expression to extract,
+    /// and the second value is the number of variants to extract.
+    Extract(usize, ArcSort),
+    /// Panic with the given message.
+    Panic(String),
+}
+
+#[derive(Clone, Debug)]
+pub struct Program(Vec<Instruction>);
+
+impl EGraph {
+    /// Takes `binding`, which is a set of variables bound during matching
+    /// whose positions are captured by indices of the `IndexSet``, and a list of core actions.
+    /// Returns a program compiled from core actions and a list of variables bound to `stack`
+    /// (whose positions are described by IndexSet indices as well).
+    pub(crate) fn compile_actions(
+        &self,
+        binding: &IndexSet<ResolvedVar>,
+        actions: &GenericCoreActions<ResolvedCall, ResolvedVar>,
+    ) -> Result<Program, Vec<TypeError>> {
+        // TODO: delete types and just keep the ordering
+        let mut types = IndexMap::default();
+        for var in binding {
+            types.insert(var.name, var.sort.clone());
+        }
+        let mut compiler = ActionCompiler {
+            types: &types,
+            locals: IndexSet::default(),
+            instructions: Vec::new(),
+        };
+
+        for a in &actions.0 {
+            compiler.compile_action(a);
+        }
+
+        Ok(Program(compiler.instructions))
+    }
+
+    // This is the ugly part. GenericCoreActions lowered from
+    // expressions like `2` is an empty vector, because no action is taken.
+    // So to explicitly obtain the return value of an expression, compile_expr
+    // needs to also take a `target`.`
+    pub(crate) fn compile_expr(
+        &self,
+        binding: &IndexSet<ResolvedVar>,
+        actions: &ResolvedCoreActions,
+        target: &ResolvedAtomTerm,
+    ) -> Result<Program, Vec<TypeError>> {
+        // TODO: delete types and just keep the ordering
+        let mut types = IndexMap::default();
+        for var in binding {
+            types.insert(var.name, var.sort.clone());
+        }
+        let mut compiler = ActionCompiler {
+            types: &types,
+            locals: IndexSet::default(),
+            instructions: Vec::new(),
+        };
+
+        for a in actions.0.iter() {
+            compiler.compile_action(a);
+        }
+        compiler.do_atom_term(target);
+
+        Ok(Program(compiler.instructions))
+    }
+
+    fn perform_set(
+        &mut self,
+        table: Symbol,
+        new_value: Value,
+        stack: &mut [Value],
+    ) -> Result<(), Error> {
+        let function = self.functions.get_mut(&table).unwrap();
+
+        let new_len = stack.len() - function.schema.input.len();
+        let args = &stack[new_len..];
+
+        // We should only have canonical values here: omit the canonicalization step
+        let old_value = function.get(args);
+
+        if let Some(old_value) = old_value {
+            if new_value != old_value {
+                let merged: Value = match function.merge.merge_vals.clone() {
+                    MergeFn::AssertEq => {
+                        return Err(Error::MergeError(table, new_value, old_value));
+                    }
+                    MergeFn::Union => self.unionfind.union_values(
+                        old_value,
+                        new_value,
+                        function.decl.schema.output,
+                    ),
+                    MergeFn::Expr(merge_prog) => {
+                        let values = [old_value, new_value];
+                        let mut stack = vec![];
+                        self.run_actions(&mut stack, &values, &merge_prog)?;
+                        stack.pop().unwrap()
+                    }
+                };
+                if merged != old_value {
+                    let args = &stack[new_len..];
+                    let function = self.functions.get_mut(&table).unwrap();
+                    function.insert(args, merged, self.timestamp);
+                }
+                // re-borrow
+                let function = self.functions.get_mut(&table).unwrap();
+                if let Some(prog) = function.merge.on_merge.clone() {
+                    let values = [old_value, new_value];
+                    // We need to pass a new stack instead of reusing the old one
+                    // because Load(Stack(idx)) use absolute index.
+                    self.run_actions(&mut Vec::new(), &values, &prog)?;
+                }
+            }
+        } else {
+            function.insert(args, new_value, self.timestamp);
+        }
+        Ok(())
+    }
+
+    pub(crate) fn run_actions(
+        &mut self,
+        stack: &mut Vec<Value>,
+        subst: &[Value],
+        program: &Program,
+    ) -> Result<(), Error> {
+        for instr in &program.0 {
+            match instr {
+                Instruction::Load(load) => match load {
+                    Load::Stack(idx) => stack.push(stack[*idx]),
+                    Load::Subst(idx) => stack.push(subst[*idx]),
+                },
+                Instruction::CallFunction(f, make_defaults) => {
+                    let function = self.functions.get_mut(f).unwrap();
+                    let new_len = stack.len() - function.schema.input.len();
+                    let values = &stack[new_len..];
+
+                    #[cfg(debug_assertions)]
+                    let output_tag = function.schema.output.name();
+
+                    #[cfg(debug_assertions)]
+                    for (ty, val) in function.schema.input.iter().zip(values) {
+                        assert_eq!(ty.name(), val.tag);
+                    }
+
+                    let value = if let Some(out) = function.nodes.get(values) {
+                        out.value
+                    } else if *make_defaults {
+                        let ts = self.timestamp;
+                        let out = &function.schema.output;
+                        match function.decl.default.as_ref() {
+                            None if out.name() == UnitSort.name() => {
+                                function.insert(values, Value::unit(), ts);
+                                Value::unit()
+                            }
+                            None if out.is_eq_sort() => {
+                                let value = Value {
+                                    #[cfg(debug_assertions)]
+                                    tag: out.name(),
+                                    bits: self.unionfind.make_set(),
+                                };
+                                function.insert(values, value, ts);
+                                value
+                            }
+                            Some(default) => {
+                                let default = default.clone();
+                                let value = self.eval_resolved_expr(&default)?;
+                                self.functions.get_mut(f).unwrap().insert(values, value, ts);
+                                value
+                            }
+                            _ => {
+                                return Err(Error::NotFoundError(NotFoundError(format!(
+                                    "No value found for {f} {:?}",
+                                    values
+                                ))))
+                            }
+                        }
+                    } else {
+                        return Err(Error::NotFoundError(NotFoundError(format!(
+                            "No value found for {f} {:?}",
+                            values
+                        ))));
+                    };
+
+                    // cfg is necessary because debug_assert_eq still evaluates its
+                    // arguments in release mode (is has to because of side effects)
+                    #[cfg(debug_assertions)]
+                    debug_assert_eq!(output_tag, value.tag);
+
+                    stack.truncate(new_len);
+                    stack.push(value);
+                }
+                Instruction::CallPrimitive(p, arity) => {
+                    let new_len = stack.len() - arity;
+                    let values = &stack[new_len..];
+                    if let Some(value) =
+                        p.primitive.apply(values, (&p.input, &p.output), Some(self))
+                    {
+                        stack.truncate(new_len);
+                        stack.push(value);
+                    } else {
+                        return Err(Error::PrimitiveError(p.primitive.clone(), values.to_vec()));
+                    }
+                }
+                Instruction::Set(f) => {
+                    let function = self.functions.get_mut(f).unwrap();
+                    // desugaring should have desugared
+                    // set to union
+                    let new_value = stack.pop().unwrap();
+                    let new_len = stack.len() - function.schema.input.len();
+
+                    self.perform_set(*f, new_value, stack)?;
+                    stack.truncate(new_len)
+                }
+                Instruction::Union(arity, sort) => {
+                    let new_len = stack.len() - arity;
+                    let values = &stack[new_len..];
+                    let first = self.unionfind.find(values[0].bits);
+                    values[1..].iter().fold(first, |a, b| {
+                        let b = self.unionfind.find(b.bits);
+                        self.unionfind.union(a, b, sort.name())
+                    });
+                    stack.truncate(new_len);
+                }
+                Instruction::Extract(arity, sort) => {
+                    let new_len = stack.len() - arity;
+                    let values = &stack[new_len..];
+                    let new_len = stack.len() - arity;
+                    let mut termdag = TermDag::default();
+
+                    let variants = values[1].bits as i64;
+                    if variants == 0 {
+                        let (cost, term) = self.extract(values[0], &mut termdag, sort);
+                        let extracted = termdag.to_string(&term);
+                        log::info!("extracted with cost {cost}: {extracted}");
+                        self.print_msg(extracted);
+                        self.extract_report = Some(ExtractReport::Best {
+                            termdag,
+                            cost,
+                            term,
+                        });
+                    } else {
+                        if variants < 0 {
+                            panic!("Cannot extract negative number of variants");
+                        }
+                        let terms =
+                            self.extract_variants(sort, values[0], variants as usize, &mut termdag);
+                        log::info!("extracted variants:");
+                        let mut msg = String::default();
+                        msg += "(\n";
+                        assert!(!terms.is_empty());
+                        for expr in &terms {
+                            let str = termdag.to_string(expr);
+                            log::info!("   {str}");
+                            msg += &format!("   {str}\n");
+                        }
+                        msg += ")";
+                        self.print_msg(msg);
+                        self.extract_report = Some(ExtractReport::Variants { termdag, terms });
+                    }
+
+                    stack.truncate(new_len);
+                }
+                Instruction::Panic(msg) => panic!("Panic: {msg}"),
+                Instruction::Literal(lit) => match lit {
+                    Literal::Int(i) => stack.push(Value::from(*i)),
+                    Literal::F64(f) => stack.push(Value::from(*f)),
+                    Literal::String(s) => stack.push(Value::from(*s)),
+                    Literal::Bool(b) => stack.push(Value::from(*b)),
+                    Literal::Unit => stack.push(Value::unit()),
+                },
+                Instruction::Change(change, f) => {
+                    let function = self.functions.get_mut(f).unwrap();
+                    let new_len = stack.len() - function.schema.input.len();
+                    let args = &stack[new_len..];
+                    match change {
+                        Change::Delete => {
+                            function.remove(args, self.timestamp);
+                        }
+                        Change::Subsume => {
+                            if function.decl.merge.is_some() {
+                                return Err(Error::SubsumeMergeError(*f));
+                            }
+                            function.subsume(args);
+                        }
+                    }
+                    stack.truncate(new_len);
+                }
+            }
+        }
+        Ok(())
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/ast/desugar.rs.html b/docs/src/egglog/ast/desugar.rs.html new file mode 100644 index 00000000..bc80a182 --- /dev/null +++ b/docs/src/egglog/ast/desugar.rs.html @@ -0,0 +1,811 @@ +desugar.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+
use super::{Rewrite, Rule};
+use crate::*;
+
+/// Desugars a list of commands into the normalized form.
+/// Gets rid of a bunch of syntactic sugar, but also
+/// makes rules into a SSA-like format (see [`NormFact`]).
+pub(crate) fn desugar_program(
+    program: Vec<Command>,
+    symbol_gen: &mut SymbolGen,
+    seminaive_transform: bool,
+) -> Result<Vec<NCommand>, Error> {
+    let mut res = vec![];
+    for command in program {
+        let desugared = desugar_command(command, symbol_gen, seminaive_transform)?;
+        res.extend(desugared);
+    }
+    Ok(res)
+}
+
+/// Desugars a single command into the normalized form.
+/// Gets rid of a bunch of syntactic sugar, but also
+/// makes rules into a SSA-like format (see [`NormFact`]).
+pub(crate) fn desugar_command(
+    command: Command,
+    symbol_gen: &mut SymbolGen,
+    seminaive_transform: bool,
+) -> Result<Vec<NCommand>, Error> {
+    let res = match command {
+        Command::SetOption { name, value } => {
+            vec![NCommand::SetOption { name, value }]
+        }
+        Command::Function(fdecl) => vec![NCommand::Function(fdecl)],
+        Command::Relation {
+            span,
+            constructor,
+            inputs,
+        } => vec![NCommand::Function(FunctionDecl::relation(
+            span,
+            constructor,
+            inputs,
+        ))],
+        Command::Datatype {
+            span,
+            name,
+            variants,
+        } => desugar_datatype(span, name, variants),
+        Command::Datatypes { span: _, datatypes } => {
+            // first declare all the datatypes as sorts, then add all explicit sorts which could refer to the datatypes, and finally add all the variants as functions
+            let mut res = vec![];
+            for datatype in datatypes.iter() {
+                let span = datatype.0.clone();
+                let name = datatype.1;
+                if let Subdatatypes::Variants(..) = datatype.2 {
+                    res.push(NCommand::Sort(span, name, None));
+                }
+            }
+            let (variants_vec, sorts): (Vec<_>, Vec<_>) = datatypes
+                .into_iter()
+                .partition(|datatype| matches!(datatype.2, Subdatatypes::Variants(..)));
+
+            for sort in sorts {
+                let span = sort.0.clone();
+                let name = sort.1;
+                let Subdatatypes::NewSort(sort, args) = sort.2 else {
+                    unreachable!()
+                };
+                res.push(NCommand::Sort(span, name, Some((sort, args))));
+            }
+
+            for variants in variants_vec {
+                let datatype = variants.1;
+                let Subdatatypes::Variants(variants) = variants.2 else {
+                    unreachable!();
+                };
+                for variant in variants {
+                    res.push(NCommand::Function(FunctionDecl {
+                        name: variant.name,
+                        schema: Schema {
+                            input: variant.types,
+                            output: datatype,
+                        },
+                        merge: None,
+                        merge_action: Actions::default(),
+                        default: None,
+                        cost: variant.cost,
+                        unextractable: false,
+                        ignore_viz: false,
+                        span: variant.span,
+                    }));
+                }
+            }
+
+            res
+        }
+        Command::Rewrite(ruleset, rewrite, subsume) => {
+            desugar_rewrite(ruleset, rewrite_name(&rewrite).into(), &rewrite, subsume)
+        }
+        Command::BiRewrite(ruleset, rewrite) => {
+            desugar_birewrite(ruleset, rewrite_name(&rewrite).into(), &rewrite)
+        }
+        Command::Include(span, file) => {
+            let s = std::fs::read_to_string(&file)
+                .unwrap_or_else(|_| panic!("{span} Failed to read file {file}"));
+            return desugar_program(
+                parse_program(Some(file), &s)?,
+                symbol_gen,
+                seminaive_transform,
+            );
+        }
+        Command::Rule {
+            ruleset,
+            mut name,
+            rule,
+        } => {
+            if name == "".into() {
+                name = rule.to_string().replace('\"', "'").into();
+            }
+
+            let mut result = vec![NCommand::NormRule {
+                ruleset,
+                name,
+                rule: rule.clone(),
+            }];
+
+            if seminaive_transform {
+                if let Some(new_rule) = add_semi_naive_rule(symbol_gen, rule) {
+                    result.push(NCommand::NormRule {
+                        ruleset,
+                        name,
+                        rule: new_rule,
+                    });
+                }
+            }
+
+            result
+        }
+        Command::Sort(span, sort, option) => vec![NCommand::Sort(span, sort, option)],
+        Command::AddRuleset(name) => vec![NCommand::AddRuleset(name)],
+        Command::UnstableCombinedRuleset(name, subrulesets) => {
+            vec![NCommand::UnstableCombinedRuleset(name, subrulesets)]
+        }
+        Command::Action(action) => vec![NCommand::CoreAction(action)],
+        Command::Simplify {
+            span,
+            expr,
+            schedule,
+        } => desugar_simplify(&expr, &schedule, span, symbol_gen),
+        Command::RunSchedule(sched) => {
+            vec![NCommand::RunSchedule(sched.clone())]
+        }
+        Command::PrintOverallStatistics => {
+            vec![NCommand::PrintOverallStatistics]
+        }
+        Command::QueryExtract {
+            span,
+            variants,
+            expr,
+        } => {
+            let variants = Expr::Lit(span.clone(), Literal::Int(variants.try_into().unwrap()));
+            if let Expr::Var(..) = expr {
+                // (extract {v} {variants})
+                vec![NCommand::CoreAction(Action::Extract(
+                    span.clone(),
+                    expr,
+                    variants,
+                ))]
+            } else {
+                // (check {expr})
+                // (ruleset {fresh_ruleset})
+                // (rule ((= {fresh} {expr}))
+                //       ((extract {fresh} {variants}))
+                //       :ruleset {fresh_ruleset})
+                // (run {fresh_ruleset} 1)
+                let fresh = symbol_gen.fresh(&"desugar_qextract_var".into());
+                let fresh_ruleset = symbol_gen.fresh(&"desugar_qextract_ruleset".into());
+                let fresh_rulename = symbol_gen.fresh(&"desugar_qextract_rulename".into());
+                let rule = Rule {
+                    span: span.clone(),
+                    body: vec![Fact::Eq(
+                        span.clone(),
+                        vec![Expr::Var(span.clone(), fresh), expr.clone()],
+                    )],
+                    head: Actions::singleton(Action::Extract(
+                        span.clone(),
+                        Expr::Var(span.clone(), fresh),
+                        variants,
+                    )),
+                };
+                vec![
+                    NCommand::Check(span.clone(), vec![Fact::Fact(expr.clone())]),
+                    NCommand::AddRuleset(fresh_ruleset),
+                    NCommand::NormRule {
+                        name: fresh_rulename,
+                        ruleset: fresh_ruleset,
+                        rule,
+                    },
+                    NCommand::RunSchedule(Schedule::Run(
+                        span.clone(),
+                        RunConfig {
+                            ruleset: fresh_ruleset,
+                            until: None,
+                        },
+                    )),
+                ]
+            }
+        }
+        Command::Check(span, facts) => vec![NCommand::Check(span, facts)],
+        Command::PrintFunction(span, symbol, size) => {
+            vec![NCommand::PrintTable(span, symbol, size)]
+        }
+        Command::PrintSize(span, symbol) => vec![NCommand::PrintSize(span, symbol)],
+        Command::Output { span, file, exprs } => vec![NCommand::Output { span, file, exprs }],
+        Command::Push(num) => {
+            vec![NCommand::Push(num)]
+        }
+        Command::Pop(span, num) => {
+            vec![NCommand::Pop(span, num)]
+        }
+        Command::Fail(span, cmd) => {
+            let mut desugared = desugar_command(*cmd, symbol_gen, seminaive_transform)?;
+
+            let last = desugared.pop().unwrap();
+            desugared.push(NCommand::Fail(span, Box::new(last)));
+            return Ok(desugared);
+        }
+        Command::Input { span, name, file } => {
+            vec![NCommand::Input { span, name, file }]
+        }
+    };
+
+    Ok(res)
+}
+
+fn desugar_datatype(span: Span, name: Symbol, variants: Vec<Variant>) -> Vec<NCommand> {
+    vec![NCommand::Sort(span.clone(), name, None)]
+        .into_iter()
+        .chain(variants.into_iter().map(|variant| {
+            NCommand::Function(FunctionDecl {
+                name: variant.name,
+                schema: Schema {
+                    input: variant.types,
+                    output: name,
+                },
+                merge: None,
+                merge_action: Actions::default(),
+                default: None,
+                cost: variant.cost,
+                unextractable: false,
+                ignore_viz: false,
+                span: variant.span,
+            })
+        }))
+        .collect()
+}
+
+fn desugar_rewrite(
+    ruleset: Symbol,
+    name: Symbol,
+    rewrite: &Rewrite,
+    subsume: bool,
+) -> Vec<NCommand> {
+    let span = rewrite.span.clone();
+    let var = Symbol::from("rewrite_var__");
+    let mut head = Actions::singleton(Action::Union(
+        span.clone(),
+        Expr::Var(span.clone(), var),
+        rewrite.rhs.clone(),
+    ));
+    if subsume {
+        match &rewrite.lhs {
+            Expr::Call(_, f, args) => {
+                head.0.push(Action::Change(
+                    span.clone(),
+                    Change::Subsume,
+                    *f,
+                    args.to_vec(),
+                ));
+            }
+            _ => {
+                panic!("Subsumed rewrite must have a function call on the lhs");
+            }
+        }
+    }
+    // make two rules- one to insert the rhs, and one to union
+    // this way, the union rule can only be fired once,
+    // which helps proofs not add too much info
+    vec![NCommand::NormRule {
+        ruleset,
+        name,
+        rule: Rule {
+            span: span.clone(),
+            body: [Fact::Eq(
+                span.clone(),
+                vec![Expr::Var(span, var), rewrite.lhs.clone()],
+            )]
+            .into_iter()
+            .chain(rewrite.conditions.clone())
+            .collect(),
+            head,
+        },
+    }]
+}
+
+fn desugar_birewrite(ruleset: Symbol, name: Symbol, rewrite: &Rewrite) -> Vec<NCommand> {
+    let span = rewrite.span.clone();
+    let rw2 = Rewrite {
+        span,
+        lhs: rewrite.rhs.clone(),
+        rhs: rewrite.lhs.clone(),
+        conditions: rewrite.conditions.clone(),
+    };
+    desugar_rewrite(ruleset, format!("{}=>", name).into(), rewrite, false)
+        .into_iter()
+        .chain(desugar_rewrite(
+            ruleset,
+            format!("{}<=", name).into(),
+            &rw2,
+            false,
+        ))
+        .collect()
+}
+
+// TODO(yz): we can delete this code once we enforce that all rule bodies cannot read the database (except EqSort).
+fn add_semi_naive_rule(symbol_gen: &mut SymbolGen, rule: Rule) -> Option<Rule> {
+    let mut new_rule = rule;
+    // Whenever an Let(_, expr@Call(...)) or Set(_, expr@Call(...)) is present in action,
+    // an additional seminaive rule should be created.
+    // Moreover, for each such expr, expr and all variable definitions that it relies on should be moved to trigger.
+    let mut new_head_atoms = vec![];
+    let mut add_new_rule = false;
+
+    let mut var_set = HashSet::default();
+    for head_slice in new_rule.head.0.iter_mut().rev() {
+        match head_slice {
+            Action::Set(span, _, _, expr) => {
+                var_set.extend(expr.vars());
+                if let Expr::Call(..) = expr {
+                    add_new_rule = true;
+
+                    let fresh_symbol = symbol_gen.fresh(&"desugar_snrule".into());
+                    let fresh_var = Expr::Var(span.clone(), fresh_symbol);
+                    let expr = std::mem::replace(expr, fresh_var.clone());
+                    new_head_atoms.push(Fact::Eq(span.clone(), vec![fresh_var, expr]));
+                };
+            }
+            Action::Let(span, symbol, expr) if var_set.contains(symbol) => {
+                var_set.extend(expr.vars());
+                if let Expr::Call(..) = expr {
+                    add_new_rule = true;
+
+                    let var = Expr::Var(span.clone(), *symbol);
+                    new_head_atoms.push(Fact::Eq(span.clone(), vec![var, expr.clone()]));
+                }
+            }
+            _ => (),
+        }
+    }
+
+    if add_new_rule {
+        new_rule.body.extend(new_head_atoms.into_iter().rev());
+        // remove all let action
+        new_rule.head.0.retain_mut(
+            |action| !matches!(action, Action::Let(_ann, var, _) if var_set.contains(var)),
+        );
+        log::debug!("Added a semi-naive desugared rule:\n{}", new_rule);
+        Some(new_rule)
+    } else {
+        None
+    }
+}
+
+fn desugar_simplify(
+    expr: &Expr,
+    schedule: &Schedule,
+    span: Span,
+    symbol_gen: &mut SymbolGen,
+) -> Vec<NCommand> {
+    let mut res = vec![NCommand::Push(1)];
+    let lhs = symbol_gen.fresh(&"desugar_simplify".into());
+    res.push(NCommand::CoreAction(Action::Let(
+        span.clone(),
+        lhs,
+        expr.clone(),
+    )));
+    res.push(NCommand::RunSchedule(schedule.clone()));
+    res.extend(
+        desugar_command(
+            Command::QueryExtract {
+                span: span.clone(),
+                variants: 0,
+                expr: Expr::Var(span.clone(), lhs),
+            },
+            symbol_gen,
+            false,
+        )
+        .unwrap(),
+    );
+
+    res.push(NCommand::Pop(span, 1));
+    res
+}
+
+pub(crate) fn rewrite_name(rewrite: &Rewrite) -> String {
+    rewrite.to_string().replace('\"', "'")
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/ast/expr.rs.html b/docs/src/egglog/ast/expr.rs.html new file mode 100644 index 00000000..a55ffe15 --- /dev/null +++ b/docs/src/egglog/ast/expr.rs.html @@ -0,0 +1,561 @@ +expr.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+
use super::ToSexp;
+use crate::{core::ResolvedCall, *};
+use ordered_float::OrderedFloat;
+use std::{fmt::Display, hash::Hasher};
+
+#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone)]
+pub enum Literal {
+    Int(i64),
+    F64(OrderedFloat<f64>),
+    String(Symbol),
+    Bool(bool),
+    Unit,
+}
+
+macro_rules! impl_from {
+    ($ctor:ident($t:ty)) => {
+        impl From<Literal> for $t {
+            fn from(literal: Literal) -> Self {
+                match literal {
+                    Literal::$ctor(t) => t,
+                    #[allow(unreachable_patterns)]
+                    _ => panic!("Expected {}, got {literal}", stringify!($ctor)),
+                }
+            }
+        }
+
+        impl From<$t> for Literal {
+            fn from(t: $t) -> Self {
+                Literal::$ctor(t)
+            }
+        }
+    };
+}
+
+impl_from!(Int(i64));
+impl_from!(F64(OrderedFloat<f64>));
+impl_from!(String(Symbol));
+
+impl Display for Literal {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        match &self {
+            Literal::Int(i) => Display::fmt(i, f),
+            Literal::F64(n) => {
+                // need to display with decimal if there is none
+                let str = n.to_string();
+                if let Ok(_num) = str.parse::<i64>() {
+                    write!(f, "{}.0", str)
+                } else {
+                    write!(f, "{}", str)
+                }
+            }
+            Literal::Bool(b) => Display::fmt(b, f),
+            Literal::String(s) => write!(f, "\"{}\"", s),
+            Literal::Unit => write!(f, "()"),
+        }
+    }
+}
+
+#[derive(Debug, Clone)]
+pub struct ResolvedVar {
+    pub name: Symbol,
+    pub sort: ArcSort,
+    /// Is this a reference to a global variable?
+    /// After the `remove_globals` pass, this should be `false`.
+    ///
+    /// NB: we distinguish between a global reference and a global binding.
+    /// The current implementation of `Eq` and `Hash` does not take this field
+    /// into consideration.
+    /// Overall, the definition of equality between two ResolvedVars is dicey.
+    pub is_global_ref: bool,
+}
+
+impl PartialEq for ResolvedVar {
+    fn eq(&self, other: &Self) -> bool {
+        self.name == other.name && self.sort.name() == other.sort.name()
+    }
+}
+
+impl Eq for ResolvedVar {}
+
+impl Hash for ResolvedVar {
+    fn hash<H: Hasher>(&self, state: &mut H) {
+        self.name.hash(state);
+        self.sort.name().hash(state);
+    }
+}
+
+impl SymbolLike for ResolvedVar {
+    fn to_symbol(&self) -> Symbol {
+        self.name
+    }
+}
+
+impl Display for ResolvedVar {
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        write!(f, "{}", self.name)
+    }
+}
+
+impl ToSexp for ResolvedVar {
+    fn to_sexp(&self) -> Sexp {
+        Sexp::Symbol(self.name.to_string())
+    }
+}
+
+pub type Expr = GenericExpr<Symbol, Symbol>;
+/// A generated expression is an expression that is generated by the system
+/// and does not have annotations.
+pub(crate) type ResolvedExpr = GenericExpr<ResolvedCall, ResolvedVar>;
+/// A [`MappedExpr`] arises naturally when you want a mapping between an expression
+/// and its flattened form. It records this mapping by annotating each `Head`
+/// with a `Leaf`, which it maps to in the flattened form.
+/// A useful operation on `MappedExpr`s is [`MappedExpr::get_corresponding_var_or_lit``].
+pub(crate) type MappedExpr<Head, Leaf> = GenericExpr<CorrespondingVar<Head, Leaf>, Leaf>;
+
+#[derive(Debug, PartialEq, Eq, Hash, Clone)]
+pub enum GenericExpr<Head, Leaf> {
+    Lit(Span, Literal),
+    Var(Span, Leaf),
+    Call(Span, Head, Vec<Self>),
+}
+
+impl ResolvedExpr {
+    pub fn output_type(&self) -> ArcSort {
+        match self {
+            ResolvedExpr::Lit(_, lit) => sort::literal_sort(lit),
+            ResolvedExpr::Var(_, resolved_var) => resolved_var.sort.clone(),
+            ResolvedExpr::Call(_, resolved_call, _) => resolved_call.output().clone(),
+        }
+    }
+
+    pub(crate) fn get_global_var(&self) -> Option<ResolvedVar> {
+        match self {
+            ResolvedExpr::Var(_, v) if v.is_global_ref => Some(v.clone()),
+            _ => None,
+        }
+    }
+}
+
+impl Expr {
+    pub fn call_no_span(op: impl Into<Symbol>, children: impl IntoIterator<Item = Self>) -> Self {
+        Self::Call(
+            DUMMY_SPAN.clone(),
+            op.into(),
+            children.into_iter().collect(),
+        )
+    }
+
+    pub fn lit_no_span(lit: impl Into<Literal>) -> Self {
+        Self::Lit(DUMMY_SPAN.clone(), lit.into())
+    }
+
+    pub fn var_no_span(v: impl Into<Symbol>) -> Self {
+        Self::Var(DUMMY_SPAN.clone(), v.into())
+    }
+}
+
+impl<Head: Clone + Display, Leaf: Hash + Clone + Display + Eq> GenericExpr<Head, Leaf> {
+    pub fn span(&self) -> Span {
+        match self {
+            GenericExpr::Lit(span, _) => span.clone(),
+            GenericExpr::Var(span, _) => span.clone(),
+            GenericExpr::Call(span, _, _) => span.clone(),
+        }
+    }
+
+    pub fn is_var(&self) -> bool {
+        matches!(self, GenericExpr::Var(_, _))
+    }
+
+    pub fn get_var(&self) -> Option<Leaf> {
+        match self {
+            GenericExpr::Var(_ann, v) => Some(v.clone()),
+            _ => None,
+        }
+    }
+
+    fn children(&self) -> &[Self] {
+        match self {
+            GenericExpr::Var(_, _) | GenericExpr::Lit(_, _) => &[],
+            GenericExpr::Call(_, _, children) => children,
+        }
+    }
+
+    pub fn ast_size(&self) -> usize {
+        let mut size = 0;
+        self.walk(&mut |_e| size += 1, &mut |_| {});
+        size
+    }
+
+    pub fn walk(&self, pre: &mut impl FnMut(&Self), post: &mut impl FnMut(&Self)) {
+        pre(self);
+        self.children()
+            .iter()
+            .for_each(|child| child.walk(pre, post));
+        post(self);
+    }
+
+    pub fn fold<Out>(&self, f: &mut impl FnMut(&Self, Vec<Out>) -> Out) -> Out {
+        let ts = self.children().iter().map(|child| child.fold(f)).collect();
+        f(self, ts)
+    }
+
+    /// Applys `f` to all sub-expressions (including `self`)
+    /// bottom-up, collecting the results.
+    pub fn visit_exprs(self, f: &mut impl FnMut(Self) -> Self) -> Self {
+        match self {
+            GenericExpr::Lit(..) => f(self),
+            GenericExpr::Var(..) => f(self),
+            GenericExpr::Call(span, op, children) => {
+                let children = children.into_iter().map(|c| c.visit_exprs(f)).collect();
+                f(GenericExpr::Call(span, op.clone(), children))
+            }
+        }
+    }
+
+    /// `subst` replaces occurrences of variables and head symbols in the expression.
+    pub fn subst<Head2, Leaf2>(
+        &self,
+        subst_leaf: &mut impl FnMut(&Span, &Leaf) -> GenericExpr<Head2, Leaf2>,
+        subst_head: &mut impl FnMut(&Head) -> Head2,
+    ) -> GenericExpr<Head2, Leaf2> {
+        match self {
+            GenericExpr::Lit(span, lit) => GenericExpr::Lit(span.clone(), lit.clone()),
+            GenericExpr::Var(span, v) => subst_leaf(span, v),
+            GenericExpr::Call(span, op, children) => {
+                let children = children
+                    .iter()
+                    .map(|c| c.subst(subst_leaf, subst_head))
+                    .collect();
+                GenericExpr::Call(span.clone(), subst_head(op), children)
+            }
+        }
+    }
+
+    pub fn subst_leaf<Leaf2>(
+        &self,
+        subst_leaf: &mut impl FnMut(&Span, &Leaf) -> GenericExpr<Head, Leaf2>,
+    ) -> GenericExpr<Head, Leaf2> {
+        self.subst(subst_leaf, &mut |x| x.clone())
+    }
+
+    pub fn vars(&self) -> impl Iterator<Item = Leaf> + '_ {
+        let iterator: Box<dyn Iterator<Item = Leaf>> = match self {
+            GenericExpr::Lit(_ann, _l) => Box::new(std::iter::empty()),
+            GenericExpr::Var(_ann, v) => Box::new(std::iter::once(v.clone())),
+            GenericExpr::Call(_ann, _head, exprs) => Box::new(exprs.iter().flat_map(|e| e.vars())),
+        };
+        iterator
+    }
+}
+
+impl<Head: Display, Leaf: Display> GenericExpr<Head, Leaf> {
+    /// Converts this expression into a
+    /// s-expression (symbolic expression).
+    /// Example: `(Add (Add 2 3) 4)`
+    pub fn to_sexp(&self) -> Sexp {
+        let res = match self {
+            GenericExpr::Lit(_ann, lit) => Sexp::Symbol(lit.to_string()),
+            GenericExpr::Var(_ann, v) => Sexp::Symbol(v.to_string()),
+            GenericExpr::Call(_ann, op, children) => Sexp::List(
+                vec![Sexp::Symbol(op.to_string())]
+                    .into_iter()
+                    .chain(children.iter().map(|c| c.to_sexp()))
+                    .collect(),
+            ),
+        };
+        res
+    }
+}
+
+impl<Head, Leaf> Display for GenericExpr<Head, Leaf>
+where
+    Head: Display,
+    Leaf: Display,
+{
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(f, "{}", self.to_sexp())
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/ast/mod.rs.html b/docs/src/egglog/ast/mod.rs.html new file mode 100644 index 00000000..bf7a38e3 --- /dev/null +++ b/docs/src/egglog/ast/mod.rs.html @@ -0,0 +1,3329 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+
pub mod desugar;
+mod expr;
+pub mod parse;
+pub(crate) mod remove_globals;
+
+use crate::{
+    core::{GenericAtom, GenericAtomTerm, HeadOrEq, Query, ResolvedCall},
+    *,
+};
+pub use expr::*;
+pub use parse::*;
+use std::fmt::Display;
+pub use symbol_table::GlobalSymbol as Symbol;
+
+#[derive(Clone, Debug)]
+/// The egglog internal representation of already compiled rules
+pub(crate) enum Ruleset {
+    /// Represents a ruleset with a set of rules.
+    /// Use an [`IndexMap`] to ensure egglog is deterministic.
+    /// Rules added to the [`IndexMap`] first apply their
+    /// actions first.
+    Rules(Symbol, IndexMap<Symbol, CompiledRule>),
+    /// A combined ruleset may contain other rulesets.
+    Combined(Symbol, Vec<Symbol>),
+}
+
+pub type NCommand = GenericNCommand<Symbol, Symbol>;
+/// [`ResolvedNCommand`] is another specialization of [`GenericNCommand`], which
+/// adds the type information to heads and leaves of commands.
+/// [`TypeInfo::typecheck_command`] turns an [`NCommand`] into a [`ResolvedNCommand`].
+pub(crate) type ResolvedNCommand = GenericNCommand<ResolvedCall, ResolvedVar>;
+
+/// A [`NCommand`] is a desugared [`Command`], where syntactic sugars
+/// like [`Command::Datatype`] and [`Command::Rewrite`]
+/// are eliminated.
+/// Most of the heavy lifting in egglog is done over [`NCommand`]s.
+///
+/// [`GenericNCommand`] is a generalization of [`NCommand`], like how [`GenericCommand`]
+/// is a generalization of [`Command`], allowing annotations over `Head` and `Leaf`.
+///
+/// TODO: The name "NCommand" used to denote normalized command, but this
+/// meaning is obsolete. A future PR should rename this type to something
+/// like "DCommand".
+#[derive(Debug, Clone, Eq, PartialEq, Hash)]
+pub enum GenericNCommand<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    SetOption {
+        name: Symbol,
+        value: GenericExpr<Head, Leaf>,
+    },
+    Sort(
+        Span,
+        Symbol,
+        Option<(Symbol, Vec<GenericExpr<Symbol, Symbol>>)>,
+    ),
+    Function(GenericFunctionDecl<Head, Leaf>),
+    AddRuleset(Symbol),
+    UnstableCombinedRuleset(Symbol, Vec<Symbol>),
+    NormRule {
+        name: Symbol,
+        ruleset: Symbol,
+        rule: GenericRule<Head, Leaf>,
+    },
+    CoreAction(GenericAction<Head, Leaf>),
+    RunSchedule(GenericSchedule<Head, Leaf>),
+    PrintOverallStatistics,
+    Check(Span, Vec<GenericFact<Head, Leaf>>),
+    PrintTable(Span, Symbol, usize),
+    PrintSize(Span, Option<Symbol>),
+    Output {
+        span: Span,
+        file: String,
+        exprs: Vec<GenericExpr<Head, Leaf>>,
+    },
+    Push(usize),
+    Pop(Span, usize),
+    Fail(Span, Box<GenericNCommand<Head, Leaf>>),
+    Input {
+        span: Span,
+        name: Symbol,
+        file: String,
+    },
+}
+
+impl<Head, Leaf> GenericNCommand<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    pub fn to_command(&self) -> GenericCommand<Head, Leaf> {
+        match self {
+            GenericNCommand::SetOption { name, value } => GenericCommand::SetOption {
+                name: *name,
+                value: value.clone(),
+            },
+            GenericNCommand::Sort(span, name, params) => {
+                GenericCommand::Sort(span.clone(), *name, params.clone())
+            }
+            GenericNCommand::Function(f) => GenericCommand::Function(f.clone()),
+            GenericNCommand::AddRuleset(name) => GenericCommand::AddRuleset(*name),
+            GenericNCommand::UnstableCombinedRuleset(name, others) => {
+                GenericCommand::UnstableCombinedRuleset(*name, others.clone())
+            }
+            GenericNCommand::NormRule {
+                name,
+                ruleset,
+                rule,
+            } => GenericCommand::Rule {
+                name: *name,
+                ruleset: *ruleset,
+                rule: rule.clone(),
+            },
+            GenericNCommand::RunSchedule(schedule) => GenericCommand::RunSchedule(schedule.clone()),
+            GenericNCommand::PrintOverallStatistics => GenericCommand::PrintOverallStatistics,
+            GenericNCommand::CoreAction(action) => GenericCommand::Action(action.clone()),
+            GenericNCommand::Check(span, facts) => {
+                GenericCommand::Check(span.clone(), facts.clone())
+            }
+            GenericNCommand::PrintTable(span, name, n) => {
+                GenericCommand::PrintFunction(span.clone(), *name, *n)
+            }
+            GenericNCommand::PrintSize(span, name) => {
+                GenericCommand::PrintSize(span.clone(), *name)
+            }
+            GenericNCommand::Output { span, file, exprs } => GenericCommand::Output {
+                span: span.clone(),
+                file: file.to_string(),
+                exprs: exprs.clone(),
+            },
+            GenericNCommand::Push(n) => GenericCommand::Push(*n),
+            GenericNCommand::Pop(span, n) => GenericCommand::Pop(span.clone(), *n),
+            GenericNCommand::Fail(span, cmd) => {
+                GenericCommand::Fail(span.clone(), Box::new(cmd.to_command()))
+            }
+            GenericNCommand::Input { span, name, file } => GenericCommand::Input {
+                span: span.clone(),
+                name: *name,
+                file: file.clone(),
+            },
+        }
+    }
+
+    pub fn visit_exprs(
+        self,
+        f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>,
+    ) -> Self {
+        match self {
+            GenericNCommand::SetOption { name, value } => GenericNCommand::SetOption {
+                name,
+                value: f(value.clone()),
+            },
+            GenericNCommand::Sort(span, name, params) => GenericNCommand::Sort(span, name, params),
+            GenericNCommand::Function(func) => GenericNCommand::Function(func.visit_exprs(f)),
+            GenericNCommand::AddRuleset(name) => GenericNCommand::AddRuleset(name),
+            GenericNCommand::UnstableCombinedRuleset(name, rulesets) => {
+                GenericNCommand::UnstableCombinedRuleset(name, rulesets)
+            }
+            GenericNCommand::NormRule {
+                name,
+                ruleset,
+                rule,
+            } => GenericNCommand::NormRule {
+                name,
+                ruleset,
+                rule: rule.visit_exprs(f),
+            },
+            GenericNCommand::RunSchedule(schedule) => {
+                GenericNCommand::RunSchedule(schedule.visit_exprs(f))
+            }
+            GenericNCommand::PrintOverallStatistics => GenericNCommand::PrintOverallStatistics,
+            GenericNCommand::CoreAction(action) => {
+                GenericNCommand::CoreAction(action.visit_exprs(f))
+            }
+            GenericNCommand::Check(span, facts) => GenericNCommand::Check(
+                span,
+                facts.into_iter().map(|fact| fact.visit_exprs(f)).collect(),
+            ),
+            GenericNCommand::PrintTable(span, name, n) => {
+                GenericNCommand::PrintTable(span, name, n)
+            }
+            GenericNCommand::PrintSize(span, name) => GenericNCommand::PrintSize(span, name),
+            GenericNCommand::Output { span, file, exprs } => GenericNCommand::Output {
+                span,
+                file,
+                exprs: exprs.into_iter().map(f).collect(),
+            },
+            GenericNCommand::Push(n) => GenericNCommand::Push(n),
+            GenericNCommand::Pop(span, n) => GenericNCommand::Pop(span, n),
+            GenericNCommand::Fail(span, cmd) => {
+                GenericNCommand::Fail(span, Box::new(cmd.visit_exprs(f)))
+            }
+            GenericNCommand::Input { span, name, file } => {
+                GenericNCommand::Input { span, name, file }
+            }
+        }
+    }
+}
+
+pub type Schedule = GenericSchedule<Symbol, Symbol>;
+pub(crate) type ResolvedSchedule = GenericSchedule<ResolvedCall, ResolvedVar>;
+
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub enum GenericSchedule<Head, Leaf> {
+    Saturate(Span, Box<GenericSchedule<Head, Leaf>>),
+    Repeat(Span, usize, Box<GenericSchedule<Head, Leaf>>),
+    Run(Span, GenericRunConfig<Head, Leaf>),
+    Sequence(Span, Vec<GenericSchedule<Head, Leaf>>),
+}
+
+pub trait ToSexp {
+    fn to_sexp(&self) -> Sexp;
+}
+
+impl ToSexp for str {
+    fn to_sexp(&self) -> Sexp {
+        Sexp::Symbol(String::from(self))
+    }
+}
+
+impl ToSexp for Symbol {
+    fn to_sexp(&self) -> Sexp {
+        Sexp::Symbol(self.to_string())
+    }
+}
+
+impl ToSexp for usize {
+    fn to_sexp(&self) -> Sexp {
+        Sexp::Symbol(self.to_string())
+    }
+}
+
+impl ToSexp for Sexp {
+    fn to_sexp(&self) -> Sexp {
+        self.clone()
+    }
+}
+
+macro_rules! list {
+    ($($e:expr,)* ++ $tail:expr) => {{
+        let mut list: Vec<Sexp> = vec![$($e.to_sexp(),)*];
+        list.extend($tail.iter().map(|e| e.to_sexp()));
+        Sexp::List(list)
+    }};
+    ($($e:expr),*) => {{
+        let list: Vec<Sexp> = vec![ $($e.to_sexp(),)* ];
+        Sexp::List(list)
+    }};
+}
+
+impl<Head, Leaf> GenericSchedule<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    fn visit_exprs(
+        self,
+        f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>,
+    ) -> Self {
+        match self {
+            GenericSchedule::Saturate(span, sched) => {
+                GenericSchedule::Saturate(span, Box::new(sched.visit_exprs(f)))
+            }
+            GenericSchedule::Repeat(span, size, sched) => {
+                GenericSchedule::Repeat(span, size, Box::new(sched.visit_exprs(f)))
+            }
+            GenericSchedule::Run(span, config) => GenericSchedule::Run(span, config.visit_exprs(f)),
+            GenericSchedule::Sequence(span, scheds) => GenericSchedule::Sequence(
+                span,
+                scheds.into_iter().map(|s| s.visit_exprs(f)).collect(),
+            ),
+        }
+    }
+}
+
+impl<Head: Display, Leaf: Display> ToSexp for GenericSchedule<Head, Leaf> {
+    fn to_sexp(&self) -> Sexp {
+        match self {
+            GenericSchedule::Saturate(_ann, sched) => list!("saturate", sched),
+            GenericSchedule::Repeat(_ann, size, sched) => list!("repeat", size, sched),
+            GenericSchedule::Run(_ann, config) => config.to_sexp(),
+            GenericSchedule::Sequence(_ann, scheds) => list!("seq", ++ scheds),
+        }
+    }
+}
+
+impl<Head: Display, Leaf: Display> Display for GenericSchedule<Head, Leaf> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(f, "{}", self.to_sexp())
+    }
+}
+
+pub type Command = GenericCommand<Symbol, Symbol>;
+
+pub type Subsume = bool;
+
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub enum Subdatatypes {
+    Variants(Vec<Variant>),
+    NewSort(Symbol, Vec<Expr>),
+}
+
+/// A [`Command`] is the top-level construct in egglog.
+/// It includes defining rules, declaring functions,
+/// adding to tables, and running rules (via a [`Schedule`]).
+#[derive(Debug, Clone)]
+pub enum GenericCommand<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    /// Egglog supports several *experimental* options
+    /// that can be set using the `set-option` command.
+    ///
+    /// Options supported include:
+    /// - "interactive_mode" (default: false): when enabled, egglog prints "(done)" after each command, allowing an external
+    /// tool to know when each command has finished running.
+    SetOption {
+        name: Symbol,
+        value: GenericExpr<Head, Leaf>,
+    },
+    /// Declare a user-defined datatype.
+    /// Datatypes can be unioned with [`Action::Union`] either
+    /// at the top level or in the actions of a rule.
+    /// This makes them equal in the implicit, global equality relation.
+
+    /// Example:
+    /// ```text
+    /// (datatype Math
+    ///   (Num i64)
+    ///   (Var String)
+    ///   (Add Math Math)
+    ///   (Mul Math Math))
+    /// ```
+
+    /// defines a simple `Math` datatype with variants for numbers, named variables, addition and multiplication.
+    ///
+    /// Datatypes desugar directly to a [`Command::Sort`] and a [`Command::Function`] for each constructor.
+    /// The code above becomes:
+    /// ```text
+    /// (sort Math)
+    /// (function Num (i64) Math)
+    /// (function Var (String) Math)
+    /// (function Add (Math Math) Math)
+    /// (function Mul (Math Math) Math)
+
+    /// Datatypes are also known as algebraic data types, tagged unions and sum types.
+    Datatype {
+        span: Span,
+        name: Symbol,
+        variants: Vec<Variant>,
+    },
+    Datatypes {
+        span: Span,
+        datatypes: Vec<(Span, Symbol, Subdatatypes)>,
+    },
+    /// Create a new user-defined sort, which can then
+    /// be used in new [`Command::Function`] declarations.
+    /// The [`Command::Datatype`] command desugars directly to this command, with one [`Command::Function`]
+    /// per constructor.
+    /// The main use of this command (as opposed to using [`Command::Datatype`]) is for forward-declaring a sort for mutually-recursive datatypes.
+    ///
+    /// It can also be used to create
+    /// a container sort.
+    /// For example, here's how to make a sort for vectors
+    /// of some user-defined sort `Math`:
+    /// ```text
+    /// (sort MathVec (Vec Math))
+    /// ```
+    ///
+    /// Now `MathVec` can be used as an input or output sort.
+    Sort(Span, Symbol, Option<(Symbol, Vec<Expr>)>),
+    /// Declare an egglog function, which is a database table with a
+    /// a functional dependency (also called a primary key) on its inputs to one output.
+    ///
+    /// ```text
+    /// (function <name:Ident> <schema:Schema> <cost:Cost>
+    ///        (:on_merge <List<Action>>)?
+    ///        (:merge <Expr>)?
+    ///        (:default <Expr>)?)
+    ///```
+    /// A function can have a `cost` for extraction.
+    /// It can also have a `default` value, which is used when calling the function.
+    ///
+    /// Finally, it can have a `merge` and `on_merge`, which are triggered when
+    /// the function dependency is violated.
+    /// In this case, the merge expression determines which of the two outputs
+    /// for the same input is used.
+    /// The `on_merge` actions are run after the merge expression is evaluated.
+    ///
+    /// Note that the `:merge` expression must be monotonic
+    /// for the behavior of the egglog program to be consistent and defined.
+    /// In other words, the merge function must define a lattice on the output of the function.
+    /// If values are merged in different orders, they should still result in the same output.
+    /// If the merge expression is not monotonic, the behavior can vary as
+    /// actions may be applied more than once with different results.
+    ///
+    /// The function is a datatype when:
+    /// - The output is not a primitive
+    /// - No merge function is provided
+    /// - No default is provided
+    ///
+    /// For example, the following is a datatype:
+    /// ```text
+    /// (function Add (i64 i64) Math)
+    /// ```
+    ///
+    /// However, this function is not:
+    /// ```text
+    /// (function LowerBound (Math) i64 :merge (max old new))
+    /// ```
+    ///
+    /// A datatype can be unioned with [`Action::Union`]
+    /// with another datatype of the same `sort`.
+    ///
+    /// Functions that are not a datatype can be `set`
+    /// with [`Action::Set`].
+    Function(GenericFunctionDecl<Head, Leaf>),
+    /// The `relation` is syntactic sugar for a named function which returns the `Unit` type.
+    /// Example:
+    /// ```text
+    /// (relation path (i64 i64))
+    /// (relation edge (i64 i64))
+    /// ```
+
+    /// Desugars to:
+    /// ```text
+    /// (function path (i64 i64) Unit :default ())
+    /// (function edge (i64 i64) Unit :default ())
+    /// ```
+    Relation {
+        span: Span,
+        constructor: Symbol,
+        inputs: Vec<Symbol>,
+    },
+    /// Using the `ruleset` command, defines a new
+    /// ruleset that can be added to in [`Command::Rule`]s.
+    /// Rulesets are used to group rules together
+    /// so that they can be run together in a [`Schedule`].
+    ///
+    /// Example:
+    /// Ruleset allows users to define a ruleset- a set of rules
+
+    /// ```text
+    /// (ruleset myrules)
+    /// (rule ((edge x y))
+    ///       ((path x y))
+    ///       :ruleset myrules)
+    /// (run myrules 2)
+    /// ```
+    AddRuleset(Symbol),
+    /// Using the `combined-ruleset` command, construct another ruleset
+    /// which runs all the rules in the given rulesets.
+    /// This is useful for running multiple rulesets together.
+    /// The combined ruleset also inherits any rules added to the individual rulesets
+    /// after the combined ruleset is declared.
+    ///
+    /// Example:
+    /// ```text
+    /// (ruleset myrules1)
+    /// (rule ((edge x y))
+    ///       ((path x y))
+    ///      :ruleset myrules1)
+    /// (ruleset myrules2)
+    /// (rule ((path x y) (edge y z))
+    ///       ((path x z))
+    ///       :ruleset myrules2)
+    /// (combined-ruleset myrules-combined myrules1 myrules2)
+    UnstableCombinedRuleset(Symbol, Vec<Symbol>),
+    /// ```text
+    /// (rule <body:List<Fact>> <head:List<Action>>)
+    /// ```
+
+    /// defines an egglog rule.
+    /// The rule matches a list of facts with respect to
+    /// the global database, and runs the list of actions
+    /// for each match.
+    /// The matches are done *modulo equality*, meaning
+    /// equal datatypes in the database are considered
+    /// equal.
+
+    /// Example:
+    /// ```text
+    /// (rule ((edge x y))
+    ///       ((path x y)))
+
+    /// (rule ((path x y) (edge y z))
+    ///       ((path x z)))
+    /// ```
+    Rule {
+        name: Symbol,
+        ruleset: Symbol,
+        rule: GenericRule<Head, Leaf>,
+    },
+    /// `rewrite` is syntactic sugar for a specific form of `rule`
+    /// which simply unions the left and right hand sides.
+    ///
+    /// Example:
+    /// ```text
+    /// (rewrite (Add a b)
+    ///          (Add b a))
+    /// ```
+    ///
+    /// Desugars to:
+    /// ```text
+    /// (rule ((= lhs (Add a b)))
+    ///       ((union lhs (Add b a))))
+    /// ```
+    ///
+    /// Additionally, additional facts can be specified
+    /// using a `:when` clause.
+    /// For example, the same rule can be run only
+    /// when `a` is zero:
+    ///
+    /// ```text
+    /// (rewrite (Add a b)
+    ///          (Add b a)
+    ///          :when ((= a (Num 0)))
+    /// ```
+    ///
+    /// Add the `:subsume` flag to cause the left hand side to be subsumed after matching, which means it can
+    /// no longer be matched in a rule, but can still be checked against (See [`Change`] for more details.)
+    ///
+    /// ```text
+    /// (rewrite (Mul a 2) (bitshift-left a 1) :subsume)
+    /// ```
+    ///
+    /// Desugars to:
+    /// ```text
+    /// (rule ((= lhs (Mul a 2)))
+    ///       ((union lhs (bitshift-left a 1))
+    ///        (subsume (Mul a 2))))
+    /// ```
+    Rewrite(Symbol, GenericRewrite<Head, Leaf>, Subsume),
+    /// Similar to [`Command::Rewrite`], but
+    /// generates two rules, one for each direction.
+    ///
+    /// Example:
+    /// ```text
+    /// (bi-rewrite (Mul (Var x) (Num 0))
+    ///             (Var x))
+    /// ```
+    ///
+    /// Becomes:
+    /// ```text
+    /// (rule ((= lhs (Mul (Var x) (Num 0))))
+    ///       ((union lhs (Var x))))
+    /// (rule ((= lhs (Var x)))
+    ///       ((union lhs (Mul (Var x) (Num 0)))))
+    /// ```
+    BiRewrite(Symbol, GenericRewrite<Head, Leaf>),
+    /// Perform an [`Action`] on the global database
+    /// (see documentation for [`Action`] for more details).
+    /// Example:
+    /// ```text
+    /// (let xplusone (Add (Var "x") (Num 1)))
+    /// ```
+    Action(GenericAction<Head, Leaf>),
+    /// Runs a [`Schedule`], which specifies
+    /// rulesets and the number of times to run them.
+    ///
+    /// Example:
+    /// ```text
+    /// (run-schedule
+    ///     (saturate my-ruleset-1)
+    ///     (run my-ruleset-2 4))
+    /// ```
+    ///
+    /// Runs `my-ruleset-1` until saturation,
+    /// then runs `my-ruleset-2` four times.
+    ///
+    /// See [`Schedule`] for more details.
+    RunSchedule(GenericSchedule<Head, Leaf>),
+    /// Print runtime statistics about rules
+    /// and rulesets so far.
+    PrintOverallStatistics,
+    // TODO provide simplify docs
+    Simplify {
+        span: Span,
+        expr: GenericExpr<Head, Leaf>,
+        schedule: GenericSchedule<Head, Leaf>,
+    },
+    /// The `query-extract` command runs a query,
+    /// extracting the result for each match that it finds.
+    /// For a simpler extraction command, use [`Action::Extract`] instead.
+    ///
+    /// Example:
+    /// ```text
+    /// (query-extract (Add a b))
+    /// ```
+    ///
+    /// Extracts every `Add` term in the database, once
+    /// for each class of equivalent `a` and `b`.
+    ///
+    /// The resulting datatype is chosen from the egraph
+    /// as the smallest term by size (taking into account
+    /// the `:cost` annotations for each constructor).
+    /// This cost does *not* take into account common sub-expressions.
+    /// For example, the following term has cost 5:
+    /// ```text
+    /// (Add
+    ///     (Num 1)
+    ///     (Num 1))
+    /// ```
+    ///
+    /// Under the hood, this command is implemented with the [`EGraph::extract`]
+    /// function.
+    QueryExtract {
+        span: Span,
+        variants: usize,
+        expr: GenericExpr<Head, Leaf>,
+    },
+    /// The `check` command checks that the given facts
+    /// match at least once in the current database.
+    /// The list of facts is matched in the same way a [`Command::Rule`] is matched.
+    ///
+    /// Example:
+
+    /// ```text
+    /// (check (= (+ 1 2) 3))
+    /// (check (<= 0 3) (>= 3 0))
+    /// (fail (check (= 1 2)))
+    /// ```
+
+    /// prints
+
+    /// ```text
+    /// [INFO ] Checked.
+    /// [INFO ] Checked.
+    /// [ERROR] Check failed
+    /// [INFO ] Command failed as expected.
+    /// ```
+    Check(Span, Vec<GenericFact<Head, Leaf>>),
+    /// Print out rows a given function, extracting each of the elements of the function.
+    /// Example:
+    /// ```text
+    /// (print-function Add 20)
+    /// ```
+    /// prints the first 20 rows of the `Add` function.
+    ///
+    PrintFunction(Span, Symbol, usize),
+    /// Print out the number of rows in a function or all functions.
+    PrintSize(Span, Option<Symbol>),
+    /// Input a CSV file directly into a function.
+    Input {
+        span: Span,
+        name: Symbol,
+        file: String,
+    },
+    /// Extract and output a set of expressions to a file.
+    Output {
+        span: Span,
+        file: String,
+        exprs: Vec<GenericExpr<Head, Leaf>>,
+    },
+    /// `push` the current egraph `n` times so that it is saved.
+    /// Later, the current database and rules can be restored using `pop`.
+    Push(usize),
+    /// `pop` the current egraph, restoring the previous one.
+    /// The argument specifies how many egraphs to pop.
+    Pop(Span, usize),
+    /// Assert that a command fails with an error.
+    Fail(Span, Box<GenericCommand<Head, Leaf>>),
+    /// Include another egglog file directly as text and run it.
+    Include(Span, String),
+}
+
+impl<Head, Leaf> ToSexp for GenericCommand<Head, Leaf>
+where
+    Head: Clone + Display + ToSexp,
+    Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,
+{
+    fn to_sexp(&self) -> Sexp {
+        match self {
+            GenericCommand::SetOption { name, value } => list!("set-option", name, value),
+            GenericCommand::Rewrite(name, rewrite, subsume) => {
+                rewrite.to_sexp(*name, false, *subsume)
+            }
+            GenericCommand::BiRewrite(name, rewrite) => rewrite.to_sexp(*name, true, false),
+            GenericCommand::Datatype {
+                span: _,
+                name,
+                variants,
+            } => list!("datatype", name, ++ variants),
+            GenericCommand::Action(a) => a.to_sexp(),
+            GenericCommand::Sort(_span, name, None) => list!("sort", name),
+            GenericCommand::Sort(_span, name, Some((name2, args))) => {
+                list!("sort", name, list!( name2, ++ args))
+            }
+            GenericCommand::Function(f) => f.to_sexp(),
+            GenericCommand::Relation {
+                span: _,
+                constructor,
+                inputs,
+            } => list!("relation", constructor, list!(++ inputs)),
+            GenericCommand::AddRuleset(name) => list!("ruleset", name),
+            GenericCommand::UnstableCombinedRuleset(name, others) => {
+                list!("unstable-combined-ruleset", name, ++ others)
+            }
+            GenericCommand::Rule {
+                name,
+                ruleset,
+                rule,
+            } => rule.to_sexp(*ruleset, *name),
+            GenericCommand::RunSchedule(sched) => list!("run-schedule", sched),
+            GenericCommand::PrintOverallStatistics => list!("print-stats"),
+            GenericCommand::QueryExtract {
+                span: _,
+                variants,
+                expr,
+            } => {
+                list!("query-extract", ":variants", variants, expr)
+            }
+            GenericCommand::Check(_ann, facts) => list!("check", ++ facts),
+            GenericCommand::Push(n) => list!("push", n),
+            GenericCommand::Pop(_span, n) => list!("pop", n),
+            GenericCommand::PrintFunction(_span, name, n) => list!("print-function", name, n),
+            GenericCommand::PrintSize(_span, name) => list!("print-size", ++ name),
+            GenericCommand::Input {
+                span: _,
+                name,
+                file,
+            } => {
+                list!("input", name, format!("\"{}\"", file))
+            }
+            GenericCommand::Output {
+                span: _,
+                file,
+                exprs,
+            } => {
+                list!("output", format!("\"{}\"", file), ++ exprs)
+            }
+            GenericCommand::Fail(_span, cmd) => list!("fail", cmd),
+            GenericCommand::Include(_span, file) => list!("include", format!("\"{}\"", file)),
+            GenericCommand::Simplify {
+                span: _,
+                expr,
+                schedule,
+            } => list!("simplify", schedule, expr),
+            GenericCommand::Datatypes { span: _, datatypes } => {
+                let datatypes: Vec<_> = datatypes
+                    .iter()
+                    .map(|(_, name, variants)| match variants {
+                        Subdatatypes::Variants(variants) => list!(name, ++ variants),
+                        Subdatatypes::NewSort(head, args) => {
+                            list!("sort", name, list!(head, ++ args))
+                        }
+                    })
+                    .collect();
+                list!("datatype*", ++ datatypes)
+            }
+        }
+    }
+}
+
+impl<Head, Leaf> Display for GenericNCommand<Head, Leaf>
+where
+    Head: Clone + Display + ToSexp,
+    Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,
+{
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        write!(f, "{}", self.to_command())
+    }
+}
+
+impl<Head, Leaf> Display for GenericCommand<Head, Leaf>
+where
+    Head: Clone + Display + ToSexp,
+    Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,
+{
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        match self {
+            GenericCommand::Rule {
+                ruleset,
+                name,
+                rule,
+            } => rule.fmt_with_ruleset(f, *ruleset, *name),
+            GenericCommand::Check(_ann, facts) => {
+                write!(f, "(check {})", ListDisplay(facts, "\n"))
+            }
+            _ => write!(f, "{}", self.to_sexp()),
+        }
+    }
+}
+
+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+pub struct IdentSort {
+    pub ident: Symbol,
+    pub sort: Symbol,
+}
+
+impl ToSexp for IdentSort {
+    fn to_sexp(&self) -> Sexp {
+        list!(self.ident, self.sort)
+    }
+}
+
+impl Display for IdentSort {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(f, "{}", self.to_sexp())
+    }
+}
+
+pub type RunConfig = GenericRunConfig<Symbol, Symbol>;
+pub(crate) type ResolvedRunConfig = GenericRunConfig<ResolvedCall, ResolvedVar>;
+
+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+pub struct GenericRunConfig<Head, Leaf> {
+    pub ruleset: Symbol,
+    pub until: Option<Vec<GenericFact<Head, Leaf>>>,
+}
+
+impl<Head, Leaf> GenericRunConfig<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    pub fn visit_exprs(
+        self,
+        f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>,
+    ) -> Self {
+        Self {
+            ruleset: self.ruleset,
+            until: self
+                .until
+                .map(|until| until.into_iter().map(|fact| fact.visit_exprs(f)).collect()),
+        }
+    }
+}
+
+impl<Head: Display, Leaf: Display> ToSexp for GenericRunConfig<Head, Leaf>
+where
+    Head: Display,
+    Leaf: Display,
+{
+    fn to_sexp(&self) -> Sexp {
+        let mut res = vec![Sexp::Symbol("run".into())];
+        if self.ruleset != "".into() {
+            res.push(Sexp::Symbol(self.ruleset.to_string()));
+        }
+        if let Some(until) = &self.until {
+            res.push(Sexp::Symbol(":until".into()));
+            res.extend(until.iter().map(|fact| fact.to_sexp()));
+        }
+
+        Sexp::List(res)
+    }
+}
+
+pub type FunctionDecl = GenericFunctionDecl<Symbol, Symbol>;
+pub(crate) type ResolvedFunctionDecl = GenericFunctionDecl<ResolvedCall, ResolvedVar>;
+
+/// Represents the declaration of a function
+/// directly parsed from source syntax.
+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+pub struct GenericFunctionDecl<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    pub name: Symbol,
+    pub schema: Schema,
+    pub default: Option<GenericExpr<Head, Leaf>>,
+    pub merge: Option<GenericExpr<Head, Leaf>>,
+    pub merge_action: GenericActions<Head, Leaf>,
+    pub cost: Option<usize>,
+    pub unextractable: bool,
+    /// Globals are desugared to functions, with this flag set to true.
+    /// This is used by visualization to handle globals differently.
+    pub ignore_viz: bool,
+    pub span: Span,
+}
+
+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+pub struct Variant {
+    pub span: Span,
+    pub name: Symbol,
+    pub types: Vec<Symbol>,
+    pub cost: Option<usize>,
+}
+
+impl ToSexp for Variant {
+    fn to_sexp(&self) -> Sexp {
+        let mut res = vec![Sexp::Symbol(self.name.to_string())];
+        if !self.types.is_empty() {
+            res.extend(self.types.iter().map(|s| Sexp::Symbol(s.to_string())));
+        }
+        if let Some(cost) = self.cost {
+            res.push(Sexp::Symbol(":cost".into()));
+            res.push(Sexp::Symbol(cost.to_string()));
+        }
+        Sexp::List(res)
+    }
+}
+
+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+pub struct Schema {
+    pub input: Vec<Symbol>,
+    pub output: Symbol,
+}
+
+impl ToSexp for Schema {
+    fn to_sexp(&self) -> Sexp {
+        list!(list!(++ self.input), self.output)
+    }
+}
+
+impl Schema {
+    pub fn new(input: Vec<Symbol>, output: Symbol) -> Self {
+        Self { input, output }
+    }
+}
+
+impl FunctionDecl {
+    pub fn relation(span: Span, name: Symbol, input: Vec<Symbol>) -> Self {
+        Self {
+            name,
+            schema: Schema {
+                input,
+                output: Symbol::from("Unit"),
+            },
+            merge: None,
+            merge_action: Actions::default(),
+            default: Some(Expr::Lit(DUMMY_SPAN.clone(), Literal::Unit)),
+            cost: None,
+            unextractable: false,
+            ignore_viz: false,
+            span,
+        }
+    }
+}
+
+impl<Head, Leaf> GenericFunctionDecl<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    pub fn visit_exprs(
+        self,
+        f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>,
+    ) -> GenericFunctionDecl<Head, Leaf> {
+        GenericFunctionDecl {
+            name: self.name,
+            schema: self.schema,
+            default: self.default.map(|expr| expr.visit_exprs(f)),
+            merge: self.merge.map(|expr| expr.visit_exprs(f)),
+            merge_action: self.merge_action.visit_exprs(f),
+            cost: self.cost,
+            unextractable: self.unextractable,
+            ignore_viz: self.ignore_viz,
+            span: self.span,
+        }
+    }
+}
+
+impl<Head, Leaf> ToSexp for GenericFunctionDecl<Head, Leaf>
+where
+    Head: Clone + Display + ToSexp,
+    Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,
+{
+    fn to_sexp(&self) -> Sexp {
+        let mut res = vec![
+            Sexp::Symbol("function".into()),
+            Sexp::Symbol(self.name.to_string()),
+        ];
+
+        if let Sexp::List(contents) = self.schema.to_sexp() {
+            res.extend(contents);
+        } else {
+            unreachable!();
+        }
+
+        if let Some(cost) = self.cost {
+            res.extend(vec![
+                Sexp::Symbol(":cost".into()),
+                Sexp::Symbol(cost.to_string()),
+            ]);
+        }
+
+        if self.unextractable {
+            res.push(Sexp::Symbol(":unextractable".into()));
+        }
+
+        if !self.merge_action.is_empty() {
+            res.push(Sexp::Symbol(":on_merge".into()));
+            res.push(Sexp::List(
+                self.merge_action.iter().map(|a| a.to_sexp()).collect(),
+            ));
+        }
+
+        if let Some(merge) = &self.merge {
+            res.push(Sexp::Symbol(":merge".into()));
+            res.push(merge.to_sexp());
+        }
+
+        if let Some(default) = &self.default {
+            res.push(Sexp::Symbol(":default".into()));
+            res.push(default.to_sexp());
+        }
+
+        Sexp::List(res)
+    }
+}
+
+pub type Fact = GenericFact<Symbol, Symbol>;
+pub(crate) type ResolvedFact = GenericFact<ResolvedCall, ResolvedVar>;
+pub(crate) type MappedFact<Head, Leaf> = GenericFact<CorrespondingVar<Head, Leaf>, Leaf>;
+
+/// Facts are the left-hand side of a [`Command::Rule`].
+/// They represent a part of a database query.
+/// Facts can be expressions or equality constraints between expressions.
+///
+/// Note that primitives such as  `!=` are partial.
+/// When two things are equal, it returns nothing and the query does not match.
+/// For example, the following egglog code runs:
+/// ```text
+/// (fail (check (!= 1 1)))
+/// ```
+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+pub enum GenericFact<Head, Leaf> {
+    /// Must be at least two things in an eq fact
+    Eq(Span, Vec<GenericExpr<Head, Leaf>>),
+    Fact(GenericExpr<Head, Leaf>),
+}
+
+pub struct Facts<Head, Leaf>(pub Vec<GenericFact<Head, Leaf>>);
+
+impl<Head, Leaf> Facts<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    /// Flattens a list of facts into a Query.
+    /// For typechecking, we need the correspondence between the original ast
+    /// and the flattened one, so that we can annotate the original with types.
+    /// That's why this function produces a corresponding list of facts, annotated with
+    /// the variable names in the flattened Query.
+    /// (Typechecking preserves the original AST this way,
+    /// and allows terms and proof instrumentation to do the same).
+    pub(crate) fn to_query(
+        &self,
+        typeinfo: &TypeInfo,
+        fresh_gen: &mut impl FreshGen<Head, Leaf>,
+    ) -> (Query<HeadOrEq<Head>, Leaf>, Vec<MappedFact<Head, Leaf>>)
+    where
+        Leaf: SymbolLike,
+    {
+        let mut atoms = vec![];
+        let mut new_body = vec![];
+
+        for fact in self.0.iter() {
+            match fact {
+                GenericFact::Eq(span, exprs) => {
+                    let mut new_exprs = vec![];
+                    let mut to_equate = vec![];
+                    for expr in exprs {
+                        let (child_atoms, expr) = expr.to_query(typeinfo, fresh_gen);
+                        atoms.extend(child_atoms);
+                        to_equate.push(expr.get_corresponding_var_or_lit(typeinfo));
+                        new_exprs.push(expr);
+                    }
+                    atoms.push(GenericAtom {
+                        span: span.clone(),
+                        head: HeadOrEq::Eq,
+                        args: to_equate,
+                    });
+                    new_body.push(GenericFact::Eq(span.clone(), new_exprs));
+                }
+                GenericFact::Fact(expr) => {
+                    let (child_atoms, expr) = expr.to_query(typeinfo, fresh_gen);
+                    atoms.extend(child_atoms);
+                    new_body.push(GenericFact::Fact(expr));
+                }
+            }
+        }
+        (Query { atoms }, new_body)
+    }
+}
+
+impl<Head: Display, Leaf: Display> ToSexp for GenericFact<Head, Leaf>
+where
+    Head: Display,
+    Leaf: Display,
+{
+    fn to_sexp(&self) -> Sexp {
+        match self {
+            GenericFact::Eq(_, exprs) => list!("=", ++ exprs),
+            GenericFact::Fact(expr) => expr.to_sexp(),
+        }
+    }
+}
+
+impl<Head, Leaf> GenericFact<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    pub(crate) fn visit_exprs(
+        self,
+        f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>,
+    ) -> GenericFact<Head, Leaf> {
+        match self {
+            GenericFact::Eq(span, exprs) => GenericFact::Eq(
+                span,
+                exprs.into_iter().map(|expr| expr.visit_exprs(f)).collect(),
+            ),
+            GenericFact::Fact(expr) => GenericFact::Fact(expr.visit_exprs(f)),
+        }
+    }
+
+    pub(crate) fn map_exprs<Head2, Leaf2>(
+        &self,
+        f: &mut impl FnMut(&GenericExpr<Head, Leaf>) -> GenericExpr<Head2, Leaf2>,
+    ) -> GenericFact<Head2, Leaf2> {
+        match self {
+            GenericFact::Eq(span, exprs) => {
+                GenericFact::Eq(span.clone(), exprs.iter().map(f).collect())
+            }
+            GenericFact::Fact(expr) => GenericFact::Fact(f(expr)),
+        }
+    }
+
+    pub(crate) fn subst<Leaf2, Head2>(
+        &self,
+        subst_leaf: &mut impl FnMut(&Span, &Leaf) -> GenericExpr<Head2, Leaf2>,
+        subst_head: &mut impl FnMut(&Head) -> Head2,
+    ) -> GenericFact<Head2, Leaf2> {
+        self.map_exprs(&mut |e| e.subst(subst_leaf, subst_head))
+    }
+}
+
+impl<Head, Leaf> GenericFact<Head, Leaf>
+where
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+    Head: Clone + Display,
+{
+    pub(crate) fn make_unresolved(self) -> GenericFact<Symbol, Symbol>
+    where
+        Leaf: SymbolLike,
+        Head: SymbolLike,
+    {
+        self.subst(
+            &mut |span, v| GenericExpr::Var(span.clone(), v.to_symbol()),
+            &mut |h| h.to_symbol(),
+        )
+    }
+}
+
+impl<Head, Leaf> Display for GenericFact<Head, Leaf>
+where
+    Head: Display,
+    Leaf: Display,
+{
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(f, "{}", self.to_sexp())
+    }
+}
+
+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+pub struct CorrespondingVar<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    pub head: Head,
+    pub to: Leaf,
+}
+
+impl<Head, Leaf> CorrespondingVar<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    pub fn new(head: Head, leaf: Leaf) -> Self {
+        Self { head, to: leaf }
+    }
+}
+
+impl<Head, Leaf> Display for CorrespondingVar<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(f, "{} -> {}", self.head, self.to)
+    }
+}
+
+/// Change a function entry.
+#[derive(Clone, Debug, Copy, PartialEq, Eq, Hash)]
+pub enum Change {
+    /// `delete` this entry from a function.
+    /// Be wary! Only delete entries that are guaranteed to be not useful.
+    Delete,
+    /// `subsume` this entry so that it cannot be queried or extracted, but still can be checked.
+    /// Note that this is currently forbidden for functions with custom merges.
+    Subsume,
+}
+
+pub type Action = GenericAction<Symbol, Symbol>;
+pub(crate) type MappedAction = GenericAction<CorrespondingVar<Symbol, Symbol>, Symbol>;
+pub(crate) type ResolvedAction = GenericAction<ResolvedCall, ResolvedVar>;
+
+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+pub enum GenericAction<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    /// Bind a variable to a particular datatype or primitive.
+    /// At the top level (in a [`Command::Action`]), this defines a global variable.
+    /// In a [`Command::Rule`], this defines a local variable in the actions.
+    Let(Span, Leaf, GenericExpr<Head, Leaf>),
+    /// `set` a function to a particular result.
+    /// `set` should not be used on datatypes-
+    /// instead, use `union`.
+    Set(
+        Span,
+        Head,
+        Vec<GenericExpr<Head, Leaf>>,
+        GenericExpr<Head, Leaf>,
+    ),
+    /// Delete or subsume (mark as hidden from future rewrites and unextractable) an entry from a function.
+    Change(Span, Change, Head, Vec<GenericExpr<Head, Leaf>>),
+    /// `union` two datatypes, making them equal
+    /// in the implicit, global equality relation
+    /// of egglog.
+    /// All rules match modulo this equality relation.
+    ///
+    /// Example:
+    /// ```text
+    /// (datatype Math (Num i64))
+    /// (union (Num 1) (Num 2)); Define that Num 1 and Num 2 are equivalent
+    /// (extract (Num 1)); Extracts Num 1
+    /// (extract (Num 2)); Extracts Num 1
+    /// ```
+    Union(Span, GenericExpr<Head, Leaf>, GenericExpr<Head, Leaf>),
+    /// `extract` a datatype from the egraph, choosing
+    /// the smallest representative.
+    /// By default, each constructor costs 1 to extract
+    /// (common subexpressions are not shared in the cost
+    /// model).
+    /// The second argument is the number of variants to
+    /// extract, picking different terms in the
+    /// same equivalence class.
+    Extract(Span, GenericExpr<Head, Leaf>, GenericExpr<Head, Leaf>),
+    Panic(Span, String),
+    Expr(Span, GenericExpr<Head, Leaf>),
+    // If(Expr, Action, Action),
+}
+
+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+
+pub struct GenericActions<Head: Clone + Display, Leaf: Clone + PartialEq + Eq + Display + Hash>(
+    pub Vec<GenericAction<Head, Leaf>>,
+);
+pub type Actions = GenericActions<Symbol, Symbol>;
+pub(crate) type ResolvedActions = GenericActions<ResolvedCall, ResolvedVar>;
+pub(crate) type MappedActions<Head, Leaf> = GenericActions<CorrespondingVar<Head, Leaf>, Leaf>;
+
+impl<Head, Leaf> Default for GenericActions<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    fn default() -> Self {
+        Self(vec![])
+    }
+}
+
+impl<Head, Leaf> GenericActions<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    pub(crate) fn len(&self) -> usize {
+        self.0.len()
+    }
+
+    pub(crate) fn iter(&self) -> impl Iterator<Item = &GenericAction<Head, Leaf>> {
+        self.0.iter()
+    }
+
+    pub(crate) fn is_empty(&self) -> bool {
+        self.0.is_empty()
+    }
+
+    pub(crate) fn visit_exprs(
+        self,
+        f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>,
+    ) -> Self {
+        Self(self.0.into_iter().map(|a| a.visit_exprs(f)).collect())
+    }
+}
+
+impl<Head, Leaf> ToSexp for GenericAction<Head, Leaf>
+where
+    Head: Clone + Display + ToSexp,
+    Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,
+{
+    fn to_sexp(&self) -> Sexp {
+        match self {
+            GenericAction::Let(_ann, lhs, rhs) => list!("let", lhs, rhs),
+            GenericAction::Set(_ann, lhs, args, rhs) => list!("set", list!(lhs, ++ args), rhs),
+            GenericAction::Union(_ann, lhs, rhs) => list!("union", lhs, rhs),
+            GenericAction::Change(_ann, change, lhs, args) => {
+                list!(
+                    match change {
+                        Change::Delete => "delete",
+                        Change::Subsume => "subsume",
+                    },
+                    list!(lhs, ++ args)
+                )
+            }
+            GenericAction::Extract(_ann, expr, variants) => list!("extract", expr, variants),
+            GenericAction::Panic(_ann, msg) => list!("panic", format!("\"{}\"", msg.clone())),
+            GenericAction::Expr(_ann, e) => e.to_sexp(),
+        }
+    }
+}
+
+impl<Head, Leaf> GenericAction<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + Eq + Display + Hash,
+{
+    // Applys `f` to all expressions in the action.
+    pub fn map_exprs(
+        &self,
+        f: &mut impl FnMut(&GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>,
+    ) -> Self {
+        match self {
+            GenericAction::Let(span, lhs, rhs) => {
+                GenericAction::Let(span.clone(), lhs.clone(), f(rhs))
+            }
+            GenericAction::Set(span, lhs, args, rhs) => {
+                let right = f(rhs);
+                GenericAction::Set(
+                    span.clone(),
+                    lhs.clone(),
+                    args.iter().map(f).collect(),
+                    right,
+                )
+            }
+            GenericAction::Change(span, change, lhs, args) => GenericAction::Change(
+                span.clone(),
+                *change,
+                lhs.clone(),
+                args.iter().map(f).collect(),
+            ),
+            GenericAction::Union(span, lhs, rhs) => {
+                GenericAction::Union(span.clone(), f(lhs), f(rhs))
+            }
+            GenericAction::Extract(span, expr, variants) => {
+                GenericAction::Extract(span.clone(), f(expr), f(variants))
+            }
+            GenericAction::Panic(span, msg) => GenericAction::Panic(span.clone(), msg.clone()),
+            GenericAction::Expr(span, e) => GenericAction::Expr(span.clone(), f(e)),
+        }
+    }
+
+    /// Applys `f` to all sub-expressions (including `self`)
+    /// bottom-up, collecting the results.
+    pub fn visit_exprs(
+        self,
+        f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>,
+    ) -> Self {
+        match self {
+            GenericAction::Let(span, lhs, rhs) => {
+                GenericAction::Let(span, lhs.clone(), rhs.visit_exprs(f))
+            }
+            // TODO should we refactor `Set` so that we can map over Expr::Call(lhs, args)?
+            // This seems more natural to oflatt
+            // Currently, visit_exprs does not apply f to the first argument of Set.
+            GenericAction::Set(span, lhs, args, rhs) => {
+                let args = args.into_iter().map(|e| e.visit_exprs(f)).collect();
+                GenericAction::Set(span, lhs.clone(), args, rhs.visit_exprs(f))
+            }
+            GenericAction::Change(span, change, lhs, args) => {
+                let args = args.into_iter().map(|e| e.visit_exprs(f)).collect();
+                GenericAction::Change(span, change, lhs.clone(), args)
+            }
+            GenericAction::Union(span, lhs, rhs) => {
+                GenericAction::Union(span, lhs.visit_exprs(f), rhs.visit_exprs(f))
+            }
+            GenericAction::Extract(span, expr, variants) => {
+                GenericAction::Extract(span, expr.visit_exprs(f), variants.visit_exprs(f))
+            }
+            GenericAction::Panic(span, msg) => GenericAction::Panic(span, msg.clone()),
+            GenericAction::Expr(span, e) => GenericAction::Expr(span, e.visit_exprs(f)),
+        }
+    }
+
+    pub fn subst(&self, subst: &mut impl FnMut(&Span, &Leaf) -> GenericExpr<Head, Leaf>) -> Self {
+        self.map_exprs(&mut |e| e.subst_leaf(subst))
+    }
+
+    pub fn map_def_use(self, fvar: &mut impl FnMut(Leaf, bool) -> Leaf) -> Self {
+        macro_rules! fvar_expr {
+            () => {
+                |span, s: _| GenericExpr::Var(span.clone(), fvar(s.clone(), false))
+            };
+        }
+        match self {
+            GenericAction::Let(span, lhs, rhs) => {
+                let lhs = fvar(lhs, true);
+                let rhs = rhs.subst_leaf(&mut fvar_expr!());
+                GenericAction::Let(span, lhs, rhs)
+            }
+            GenericAction::Set(span, lhs, args, rhs) => {
+                let args = args
+                    .into_iter()
+                    .map(|e| e.subst_leaf(&mut fvar_expr!()))
+                    .collect();
+                let rhs = rhs.subst_leaf(&mut fvar_expr!());
+                GenericAction::Set(span, lhs.clone(), args, rhs)
+            }
+            GenericAction::Change(span, change, lhs, args) => {
+                let args = args
+                    .into_iter()
+                    .map(|e| e.subst_leaf(&mut fvar_expr!()))
+                    .collect();
+                GenericAction::Change(span, change, lhs.clone(), args)
+            }
+            GenericAction::Union(span, lhs, rhs) => {
+                let lhs = lhs.subst_leaf(&mut fvar_expr!());
+                let rhs = rhs.subst_leaf(&mut fvar_expr!());
+                GenericAction::Union(span, lhs, rhs)
+            }
+            GenericAction::Extract(span, expr, variants) => {
+                let expr = expr.subst_leaf(&mut fvar_expr!());
+                let variants = variants.subst_leaf(&mut fvar_expr!());
+                GenericAction::Extract(span, expr, variants)
+            }
+            GenericAction::Panic(span, msg) => GenericAction::Panic(span, msg.clone()),
+            GenericAction::Expr(span, e) => {
+                GenericAction::Expr(span, e.subst_leaf(&mut fvar_expr!()))
+            }
+        }
+    }
+}
+
+impl<Head, Leaf> Display for GenericAction<Head, Leaf>
+where
+    Head: Clone + Display + ToSexp,
+    Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,
+{
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(f, "{}", self.to_sexp())
+    }
+}
+
+#[derive(Clone, Debug)]
+pub(crate) struct CompiledRule {
+    pub(crate) query: CompiledQuery,
+    pub(crate) program: Program,
+}
+
+pub type Rule = GenericRule<Symbol, Symbol>;
+pub(crate) type ResolvedRule = GenericRule<ResolvedCall, ResolvedVar>;
+
+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+pub struct GenericRule<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    pub span: Span,
+    pub head: GenericActions<Head, Leaf>,
+    pub body: Vec<GenericFact<Head, Leaf>>,
+}
+
+impl<Head, Leaf> GenericRule<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    pub(crate) fn visit_exprs(
+        self,
+        f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>,
+    ) -> Self {
+        Self {
+            span: self.span,
+            head: self.head.visit_exprs(f),
+            body: self
+                .body
+                .into_iter()
+                .map(|bexpr| bexpr.visit_exprs(f))
+                .collect(),
+        }
+    }
+}
+
+impl<Head, Leaf> GenericRule<Head, Leaf>
+where
+    Head: Clone + Display + ToSexp,
+    Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,
+{
+    pub(crate) fn fmt_with_ruleset(
+        &self,
+        f: &mut std::fmt::Formatter<'_>,
+        ruleset: Symbol,
+        name: Symbol,
+    ) -> std::fmt::Result {
+        let indent = " ".repeat(7);
+        write!(f, "(rule (")?;
+        for (i, fact) in self.body.iter().enumerate() {
+            if i > 0 {
+                write!(f, "{}", indent)?;
+            }
+
+            if i != self.body.len() - 1 {
+                writeln!(f, "{}", fact)?;
+            } else {
+                write!(f, "{}", fact)?;
+            }
+        }
+        write!(f, ")\n      (")?;
+        for (i, action) in self.head.0.iter().enumerate() {
+            if i > 0 {
+                write!(f, "{}", indent)?;
+            }
+            if i != self.head.0.len() - 1 {
+                writeln!(f, "{}", action)?;
+            } else {
+                write!(f, "{}", action)?;
+            }
+        }
+        let ruleset = if ruleset != "".into() {
+            format!(":ruleset {}", ruleset)
+        } else {
+            "".into()
+        };
+        let name = if name != "".into() {
+            format!(":name \"{}\"", name)
+        } else {
+            "".into()
+        };
+        write!(f, ")\n{} {} {})", indent, ruleset, name)
+    }
+}
+
+impl<Head, Leaf> GenericRule<Head, Leaf>
+where
+    Head: Clone + Display + ToSexp,
+    Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,
+{
+    /// Converts this rule into an s-expression.
+    pub fn to_sexp(&self, ruleset: Symbol, name: Symbol) -> Sexp {
+        let mut res = vec![
+            Sexp::Symbol("rule".into()),
+            Sexp::List(self.body.iter().map(|f| f.to_sexp()).collect()),
+            Sexp::List(self.head.0.iter().map(|a| a.to_sexp()).collect()),
+        ];
+        if ruleset != "".into() {
+            res.push(Sexp::Symbol(":ruleset".into()));
+            res.push(Sexp::Symbol(ruleset.to_string()));
+        }
+        if name != "".into() {
+            res.push(Sexp::Symbol(":name".into()));
+            res.push(Sexp::Symbol(format!("\"{}\"", name)));
+        }
+        Sexp::List(res)
+    }
+}
+
+impl<Head, Leaf> Display for GenericRule<Head, Leaf>
+where
+    Head: Clone + Display + ToSexp,
+    Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,
+{
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        self.fmt_with_ruleset(f, "".into(), "".into())
+    }
+}
+
+pub type Rewrite = GenericRewrite<Symbol, Symbol>;
+
+#[derive(Clone, Debug)]
+pub struct GenericRewrite<Head, Leaf> {
+    pub span: Span,
+    pub lhs: GenericExpr<Head, Leaf>,
+    pub rhs: GenericExpr<Head, Leaf>,
+    pub conditions: Vec<GenericFact<Head, Leaf>>,
+}
+
+impl<Head: Display, Leaf: Display> GenericRewrite<Head, Leaf> {
+    /// Converts the rewrite into an s-expression.
+    pub fn to_sexp(&self, ruleset: Symbol, is_bidirectional: bool, subsume: bool) -> Sexp {
+        let mut res = vec![
+            Sexp::Symbol(if is_bidirectional {
+                "birewrite".into()
+            } else {
+                "rewrite".into()
+            }),
+            self.lhs.to_sexp(),
+            self.rhs.to_sexp(),
+        ];
+        if subsume {
+            res.push(Sexp::Symbol(":subsume".into()));
+        }
+
+        if !self.conditions.is_empty() {
+            res.push(Sexp::Symbol(":when".into()));
+            res.push(Sexp::List(
+                self.conditions.iter().map(|f| f.to_sexp()).collect(),
+            ));
+        }
+
+        if ruleset != "".into() {
+            res.push(Sexp::Symbol(":ruleset".into()));
+            res.push(Sexp::Symbol(ruleset.to_string()));
+        }
+        Sexp::List(res)
+    }
+}
+
+impl<Head: Display, Leaf: Display> Display for GenericRewrite<Head, Leaf> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(f, "{}", self.to_sexp("".into(), false, false))
+    }
+}
+
+impl<Head, Leaf: Clone> MappedExpr<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    pub(crate) fn get_corresponding_var_or_lit(&self, typeinfo: &TypeInfo) -> GenericAtomTerm<Leaf>
+    where
+        Leaf: SymbolLike,
+    {
+        // Note: need typeinfo to resolve whether a symbol is a global or not
+        // This is error-prone and the complexities can be avoided by treating globals
+        // as nullary functions.
+        match self {
+            GenericExpr::Var(span, v) => {
+                if typeinfo.is_global(v.to_symbol()) {
+                    GenericAtomTerm::Global(span.clone(), v.clone())
+                } else {
+                    GenericAtomTerm::Var(span.clone(), v.clone())
+                }
+            }
+            GenericExpr::Lit(span, lit) => GenericAtomTerm::Literal(span.clone(), lit.clone()),
+            GenericExpr::Call(span, head, _) => GenericAtomTerm::Var(span.clone(), head.to.clone()),
+        }
+    }
+}
+
+impl<Head, Leaf> GenericActions<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    pub fn new(actions: Vec<GenericAction<Head, Leaf>>) -> Self {
+        Self(actions)
+    }
+
+    pub fn singleton(action: GenericAction<Head, Leaf>) -> Self {
+        Self(vec![action])
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/ast/parse.rs.html b/docs/src/egglog/ast/parse.rs.html new file mode 100644 index 00000000..0c350367 --- /dev/null +++ b/docs/src/egglog/ast/parse.rs.html @@ -0,0 +1,1647 @@ +parse.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+
//! Parse a string into egglog.
+
+use crate::*;
+use ordered_float::OrderedFloat;
+
+pub fn parse_program(filename: Option<String>, input: &str) -> Result<Vec<Command>, ParseError> {
+    let (out, _span, rest) = program(&Context::new(filename, input))?;
+    assert!(rest.is_at_end(), "did not parse entire program");
+    Ok(out)
+}
+
+// currently only used for testing, but no reason it couldn't be used elsewhere later
+pub fn parse_expr(filename: Option<String>, input: &str) -> Result<Expr, ParseError> {
+    let (out, _span, rest) = expr(&Context::new(filename, input))?;
+    assert!(rest.is_at_end(), "did not parse entire expression");
+    Ok(out)
+}
+
+/// A [`Span`] contains the file name and a pair of offsets representing the start and the end.
+#[derive(Clone, PartialEq, Eq, Hash)]
+pub struct Span(Arc<SrcFile>, usize, usize);
+
+lazy_static::lazy_static! {
+    pub static ref DUMMY_SPAN: Span = Span(Arc::new(SrcFile {name: None, contents: String::new()}), 0, 0);
+}
+
+impl Span {
+    pub fn string(&self) -> &str {
+        &self.0.contents[self.1..self.2]
+    }
+}
+
+#[derive(Debug, PartialEq, Eq, Hash)]
+struct SrcFile {
+    name: Option<String>,
+    contents: String,
+}
+
+struct Location {
+    line: usize,
+    col: usize,
+}
+
+impl SrcFile {
+    pub fn get_location(&self, offset: usize) -> Location {
+        let mut line = 1;
+        let mut col = 1;
+        for (i, c) in self.contents.char_indices() {
+            if i == offset {
+                break;
+            }
+            if c == '\n' {
+                line += 1;
+                col = 1;
+            } else {
+                col += 1;
+            }
+        }
+        Location { line, col }
+    }
+}
+
+// we do this slightly un-idiomatic thing because `unwrap` and `expect`
+// would print the entire source program without this
+impl Debug for Span {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        write!(f, "{}", self)
+    }
+}
+
+impl Display for Span {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        let start = self.0.get_location(self.1);
+        let end = self.0.get_location((self.2 - 1).max(self.1));
+        let quote = self.string();
+        match (&self.0.name, start.line == end.line) {
+            (Some(filename), true) => write!(
+                f,
+                "In {}:{}-{} of {filename}: {quote}",
+                start.line, start.col, end.col
+            ),
+            (Some(filename), false) => write!(
+                f,
+                "In {}:{}-{}:{} of {filename}: {quote}",
+                start.line, start.col, end.line, end.col
+            ),
+            (None, false) => write!(
+                f,
+                "In {}:{}-{}:{}: {quote}",
+                start.line, start.col, end.line, end.col
+            ),
+            (None, true) => write!(f, "In {}:{}-{}: {quote}", start.line, start.col, end.col),
+        }
+    }
+}
+
+#[derive(Clone, Debug)]
+struct Context {
+    source: Arc<SrcFile>,
+    index: usize,
+}
+
+impl Context {
+    fn new(name: Option<String>, contents: &str) -> Context {
+        let mut next = Context {
+            source: Arc::new(SrcFile {
+                name,
+                contents: contents.to_string(),
+            }),
+            index: 0,
+        };
+        next.advance_past_whitespace();
+        next
+    }
+
+    fn current_char(&self) -> Option<char> {
+        self.source.contents[self.index..].chars().next()
+    }
+
+    fn advance_char(&mut self) {
+        assert!(self.index < self.source.contents.len());
+        loop {
+            self.index += 1;
+            if self.source.contents.is_char_boundary(self.index) {
+                break;
+            }
+        }
+    }
+
+    fn advance_past_whitespace(&mut self) {
+        let mut in_comment = false;
+        loop {
+            match self.current_char() {
+                None => break,
+                Some(';') => in_comment = true,
+                Some('\n') => in_comment = false,
+                Some(c) if c.is_whitespace() => {}
+                Some(_) if in_comment => {}
+                Some(_) => break,
+            }
+            self.advance_char();
+        }
+    }
+
+    fn is_at_end(&self) -> bool {
+        self.index == self.source.contents.len()
+    }
+
+    fn span(&self) -> Span {
+        Span(self.source.clone(), self.index, self.index)
+    }
+}
+
+type Res<T> = Result<(T, Span, Context), ParseError>;
+
+trait Parser<T>: Fn(&Context) -> Res<T> + Clone {
+    fn map<U>(self, f: impl Fn(T, Span) -> U + Clone) -> impl Parser<U> {
+        move |ctx| {
+            let (x, span, next) = self(ctx)?;
+            Ok((f(x, span.clone()), span, next))
+        }
+    }
+}
+impl<T, F: Fn(&Context) -> Res<T> + Clone> Parser<T> for F {}
+
+fn ident(ctx: &Context) -> Res<Symbol> {
+    let mut span = ctx.span();
+    if ctx.index >= ctx.source.contents.len() {
+        return Err(ParseError::EndOfFile(span));
+    }
+
+    let mut next = ctx.clone();
+    loop {
+        match next.current_char() {
+            None => break,
+            Some(c) if c.is_alphanumeric() => {}
+            Some(c) if "-+*/?!=<>&|^/%_.".contains(c) => {}
+            Some(_) => break,
+        }
+        next.advance_char();
+    }
+    span.2 = next.index;
+
+    if span.1 == span.2 {
+        Err(ParseError::Ident(span))
+    } else {
+        next.advance_past_whitespace();
+        Ok((Symbol::from(span.string()), span, next))
+    }
+}
+
+fn text(s: &str) -> impl Parser<()> + '_ {
+    move |ctx| {
+        let mut span = ctx.span();
+        span.2 = (span.1 + s.len()).min(ctx.source.contents.len());
+
+        if span.string() == s {
+            let mut next = ctx.clone();
+            next.index += s.len();
+            next.advance_past_whitespace();
+            Ok(((), span, next))
+        } else {
+            Err(ParseError::Text(span, s.to_string()))
+        }
+    }
+}
+
+fn repeat_until<T>(
+    inner: impl Parser<T>,
+    end: impl Fn(&Context) -> bool + Clone,
+) -> impl Parser<Vec<T>> {
+    move |ctx| {
+        let mut vec = Vec::new();
+        let mut span = ctx.span();
+        let mut next = ctx.clone();
+        while !end(&next) {
+            let (x, s, n) = inner(&next)?;
+            vec.push(x);
+            next = n;
+            span.2 = s.2;
+        }
+        Ok((vec, span, next))
+    }
+}
+
+fn repeat_until_end_paren<T>(inner: impl Parser<T>) -> impl Parser<Vec<T>> {
+    repeat_until(inner, |ctx| text(")")(ctx).is_ok())
+}
+
+fn choice<T>(a: impl Parser<T>, b: impl Parser<T>) -> impl Parser<T> {
+    move |ctx| a(ctx).or_else(|_| b(ctx))
+}
+
+macro_rules! choices {
+    ( $x:expr ) => { $x };
+    ( $x:expr , $( $xs:expr ),+ $(,)? ) => {
+        choice( $x, choices!( $( $xs ),+ ) )
+    };
+}
+
+fn sequence<T, U>(a: impl Parser<T>, b: impl Parser<U>) -> impl Parser<(T, U)> {
+    move |ctx| {
+        let (x, lo, next) = a(ctx)?;
+        let (y, hi, next) = b(&next)?;
+        Ok(((x, y), Span(lo.0, lo.1, hi.2), next))
+    }
+}
+
+macro_rules! sequences {
+    ( $x:expr ) => { $x };
+    ( $x:expr , $( $xs:expr ),+ $(,)? ) => {
+        sequence( $x, sequences!( $( $xs ),+ ) )
+    };
+}
+
+fn sequence3<T, U, V>(
+    a: impl Parser<T>,
+    b: impl Parser<U>,
+    c: impl Parser<V>,
+) -> impl Parser<(T, U, V)> {
+    sequences!(a, b, c).map(|(a, (b, c)), _| (a, b, c))
+}
+
+fn sequence4<T, U, V, W>(
+    a: impl Parser<T>,
+    b: impl Parser<U>,
+    c: impl Parser<V>,
+    d: impl Parser<W>,
+) -> impl Parser<(T, U, V, W)> {
+    sequences!(a, b, c, d).map(|(a, (b, (c, d))), _| (a, b, c, d))
+}
+
+fn option<T>(parser: impl Parser<T>) -> impl Parser<Option<T>> {
+    move |ctx| match parser(ctx) {
+        Ok((x, span, next)) => Ok((Some(x), span, next)),
+        Err(_) => Ok((None, ctx.span(), ctx.clone())),
+    }
+}
+
+fn parens<T>(f: impl Parser<T>) -> impl Parser<T> {
+    choice(
+        sequence3(text("["), f.clone(), text("]")),
+        sequence3(text("("), f.clone(), text(")")),
+    )
+    .map(|((), x, ()), _| x)
+}
+
+fn program(ctx: &Context) -> Res<Vec<Command>> {
+    repeat_until(command, |ctx| ctx.index == ctx.source.contents.len())(ctx)
+}
+
+fn rec_datatype(ctx: &Context) -> Res<(Span, Symbol, Subdatatypes)> {
+    choice(
+        parens(sequence3(
+            text("sort"),
+            ident,
+            parens(sequence(ident, repeat_until_end_paren(expr))),
+        ))
+        .map(|((), name, (head, exprs)), span| (span, name, Subdatatypes::NewSort(head, exprs))),
+        parens(sequence(ident, repeat_until_end_paren(variant)))
+            .map(|(name, variants), span| (span, name, Subdatatypes::Variants(variants))),
+    )(ctx)
+}
+
+fn list<T>(f: impl Parser<T>) -> impl Parser<Vec<T>> {
+    parens(repeat_until_end_paren(f))
+}
+
+fn snd<T, U>(x: Option<(T, U)>, _span: Span) -> Option<U> {
+    x.map(|(_, x)| x)
+}
+
+fn ident_after_paren(ctx: &Context) -> &str {
+    match sequence(choice(text("("), text("[")), ident)(ctx) {
+        Ok((((), symbol), _, _)) => symbol.into(),
+        Err(_) => "",
+    }
+}
+
+fn command(ctx: &Context) -> Res<Command> {
+    match ident_after_paren(ctx) {
+        "set-option" => {
+            parens(sequence3(text("set-option"), ident, expr))
+                .map(|((), name, value), _| Command::SetOption { name, value })(ctx)
+        }
+        "datatype" => parens(sequence3(
+            text("datatype"),
+            ident,
+            repeat_until_end_paren(variant),
+        ))
+        .map(|((), name, variants), span| Command::Datatype {
+            span,
+            name,
+            variants,
+        })(ctx),
+        "sort" => choice(
+            parens(sequence3(
+                text("sort"),
+                ident,
+                parens(sequence(ident, repeat_until_end_paren(expr))),
+            ))
+            .map(|((), name, (head, tail)), span| Command::Sort(span, name, Some((head, tail)))),
+            parens(sequence(text("sort"), ident))
+                .map(|((), name), span| Command::Sort(span, name, None)),
+        )(ctx),
+        "datatype*" => {
+            parens(sequence(
+                text("datatype*"),
+                repeat_until_end_paren(rec_datatype),
+            ))
+            .map(|((), datatypes), span| Command::Datatypes { span, datatypes })(ctx)
+        }
+        "function" => parens(sequences!(
+            text("function"),
+            ident,
+            schema,
+            cost,
+            option(text(":unextractable")).map(|x, _| x.is_some()),
+            option(sequence(text(":on_merge"), list(action))).map(snd),
+            option(sequence(text(":merge"), expr)).map(snd),
+            option(sequence(text(":default"), expr)).map(snd),
+        ))
+        .map(
+            |((), (name, (schema, (cost, (unextractable, (merge_action, (merge, default))))))),
+             span| {
+                Command::Function(FunctionDecl {
+                    span,
+                    name,
+                    schema,
+                    merge,
+                    merge_action: Actions::new(merge_action.unwrap_or_default()),
+                    default,
+                    cost,
+                    unextractable,
+                    ignore_viz: false,
+                })
+            },
+        )(ctx),
+        "relation" => parens(sequence3(text("relation"), ident, list(r#type))).map(
+            |((), constructor, inputs), span| Command::Relation {
+                span,
+                constructor,
+                inputs,
+            },
+        )(ctx),
+        "ruleset" => parens(sequence(text("ruleset"), ident))
+            .map(|((), name), _| Command::AddRuleset(name))(ctx),
+        "unstable-combined-ruleset" => parens(sequence3(
+            text("unstable-combined-ruleset"),
+            ident,
+            repeat_until_end_paren(ident),
+        ))
+        .map(|((), name, subrulesets), _| Command::UnstableCombinedRuleset(name, subrulesets))(
+            ctx
+        ),
+        "rule" => parens(sequences!(
+            text("rule"),
+            list(fact),
+            list(action).map(|x, _| Actions::new(x)),
+            option(sequence(text(":ruleset"), ident)).map(snd),
+            option(sequence(text(":name"), string)).map(snd),
+        ))
+        .map(
+            |((), (body, (head, (ruleset, name)))), span| Command::Rule {
+                ruleset: ruleset.unwrap_or("".into()),
+                name: name.unwrap_or("".to_string()).into(),
+                rule: Rule { span, head, body },
+            },
+        )(ctx),
+        "rewrite" => parens(sequences!(
+            text("rewrite"),
+            expr,
+            expr,
+            option(text(":subsume")).map(|x, _| x.is_some()),
+            option(sequence(text(":when"), list(fact))).map(snd),
+            option(sequence(text(":ruleset"), ident)).map(snd),
+        ))
+        .map(
+            |((), (lhs, (rhs, (subsume, (conditions, ruleset))))), span| {
+                Command::Rewrite(
+                    ruleset.unwrap_or("".into()),
+                    Rewrite {
+                        span,
+                        lhs,
+                        rhs,
+                        conditions: conditions.unwrap_or_default(),
+                    },
+                    subsume,
+                )
+            },
+        )(ctx),
+        "birewrite" => parens(sequences!(
+            text("birewrite"),
+            expr,
+            expr,
+            option(sequence(text(":when"), list(fact))).map(snd),
+            option(sequence(text(":ruleset"), ident)).map(snd),
+        ))
+        .map(|((), (lhs, (rhs, (conditions, ruleset)))), span| {
+            Command::BiRewrite(
+                ruleset.unwrap_or("".into()),
+                Rewrite {
+                    span,
+                    lhs,
+                    rhs,
+                    conditions: conditions.unwrap_or_default(),
+                },
+            )
+        })(ctx),
+        "let" => parens(sequence3(text("let"), ident, expr))
+            .map(|((), name, expr), span| Command::Action(Action::Let(span, name, expr)))(
+            ctx
+        ),
+        "run" => choice(
+            parens(sequence3(
+                text("run"),
+                unum,
+                option(sequence(text(":until"), repeat_until_end_paren(fact))).map(snd),
+            ))
+            .map(|((), limit, until), span| {
+                Command::RunSchedule(Schedule::Repeat(
+                    span.clone(),
+                    limit,
+                    Box::new(Schedule::Run(
+                        span,
+                        RunConfig {
+                            ruleset: "".into(),
+                            until,
+                        },
+                    )),
+                ))
+            }),
+            parens(sequence4(
+                text("run"),
+                ident,
+                unum,
+                option(sequence(text(":until"), repeat_until_end_paren(fact))).map(snd),
+            ))
+            .map(|((), ruleset, limit, until), span| {
+                Command::RunSchedule(Schedule::Repeat(
+                    span.clone(),
+                    limit,
+                    Box::new(Schedule::Run(span, RunConfig { ruleset, until })),
+                ))
+            }),
+        )(ctx),
+        "simplify" => {
+            parens(sequence3(text("simplify"), schedule, expr)).map(|((), schedule, expr), span| {
+                Command::Simplify {
+                    span,
+                    expr,
+                    schedule,
+                }
+            })(ctx)
+        }
+        "query-extract" => parens(sequence3(
+            text("query-extract"),
+            option(sequence(text(":variants"), unum)).map(snd),
+            expr,
+        ))
+        .map(|((), variants, expr), span| Command::QueryExtract {
+            span,
+            expr,
+            variants: variants.unwrap_or(0),
+        })(ctx),
+        "check" => parens(sequence(text("check"), repeat_until_end_paren(fact)))
+            .map(|((), facts), span| Command::Check(span, facts))(ctx),
+        "run-schedule" => parens(sequence(
+            text("run-schedule"),
+            repeat_until_end_paren(schedule),
+        ))
+        .map(|((), scheds), span| Command::RunSchedule(Schedule::Sequence(span, scheds)))(
+            ctx
+        ),
+        "print-stats" => {
+            parens(text("print-stats")).map(|(), _| Command::PrintOverallStatistics)(ctx)
+        }
+        "push" => parens(sequence(text("push"), option(unum)))
+            .map(|((), n), _| Command::Push(n.unwrap_or(1)))(ctx),
+        "pop" => parens(sequence(text("pop"), option(unum)))
+            .map(|((), n), span| Command::Pop(span, n.unwrap_or(1)))(ctx),
+        "print-function" => {
+            parens(sequence3(text("print-function"), ident, unum))
+                .map(|((), sym, n), span| Command::PrintFunction(span, sym, n))(ctx)
+        }
+        "print-size" => parens(sequence(text("print-size"), option(ident)))
+            .map(|((), sym), span| Command::PrintSize(span, sym))(ctx),
+        "input" => {
+            parens(sequence3(text("input"), ident, string))
+                .map(|((), name, file), span| Command::Input { span, name, file })(ctx)
+        }
+        "output" => parens(sequence4(
+            text("output"),
+            string,
+            expr,
+            repeat_until_end_paren(expr),
+        ))
+        .map(|((), file, e, mut exprs), span| {
+            exprs.insert(0, e);
+            Command::Output { span, file, exprs }
+        })(ctx),
+        "fail" => parens(sequence(text("fail"), command))
+            .map(|((), c), span| Command::Fail(span, Box::new(c)))(ctx),
+        "include" => parens(sequence(text("include"), string))
+            .map(|((), file), span| Command::Include(span, file))(ctx),
+        _ => non_let_action.map(|action, _| Command::Action(action))(ctx),
+    }
+}
+
+fn schedule(ctx: &Context) -> Res<Schedule> {
+    match ident_after_paren(ctx) {
+        "saturate" => parens(sequence(text("saturate"), repeat_until_end_paren(schedule))).map(
+            |((), scheds), span| {
+                Schedule::Saturate(span.clone(), Box::new(Schedule::Sequence(span, scheds)))
+            },
+        )(ctx),
+        "seq" => parens(sequence(text("seq"), repeat_until_end_paren(schedule)))
+            .map(|((), scheds), span| Schedule::Sequence(span, scheds))(ctx),
+        "repeat" => parens(sequence3(
+            text("repeat"),
+            unum,
+            repeat_until_end_paren(schedule),
+        ))
+        .map(|((), limit, scheds), span| {
+            Schedule::Repeat(
+                span.clone(),
+                limit,
+                Box::new(Schedule::Sequence(span, scheds)),
+            )
+        })(ctx),
+        "run" => choice(
+            parens(sequence(
+                text("run"),
+                option(sequence(text(":until"), repeat_until_end_paren(fact))).map(snd),
+            ))
+            .map(|((), until), span| {
+                Schedule::Run(
+                    span,
+                    RunConfig {
+                        ruleset: "".into(),
+                        until,
+                    },
+                )
+            }),
+            parens(sequence3(
+                text("run"),
+                ident,
+                option(sequence(text(":until"), repeat_until_end_paren(fact))).map(snd),
+            ))
+            .map(|((), ruleset, until), span| Schedule::Run(span, RunConfig { ruleset, until })),
+        )(ctx),
+        _ => ident.map(|ruleset, span| {
+            Schedule::Run(
+                span.clone(),
+                RunConfig {
+                    ruleset,
+                    until: None,
+                },
+            )
+        })(ctx),
+    }
+}
+
+fn cost(ctx: &Context) -> Res<Option<usize>> {
+    option(sequence(text(":cost"), unum)).map(snd)(ctx)
+}
+
+fn action(ctx: &Context) -> Res<Action> {
+    choice(
+        parens(sequence3(text("let"), ident, expr))
+            .map(|((), name, expr), span| Action::Let(span, name, expr)),
+        non_let_action,
+    )(ctx)
+}
+
+fn non_let_action(ctx: &Context) -> Res<Action> {
+    match ident_after_paren(ctx) {
+        "set" => parens(sequence3(
+            text("set"),
+            parens(sequence(ident, repeat_until_end_paren(expr))),
+            expr,
+        ))
+        .map(|((), (f, args), v), span| Action::Set(span, f, args, v))(ctx),
+        "delete" => parens(sequence(
+            text("delete"),
+            parens(sequence(ident, repeat_until_end_paren(expr))),
+        ))
+        .map(|((), (f, args)), span| Action::Change(span, Change::Delete, f, args))(
+            ctx
+        ),
+        "subsume" => parens(sequence(
+            text("subsume"),
+            parens(sequence(ident, repeat_until_end_paren(expr))),
+        ))
+        .map(|((), (f, args)), span| Action::Change(span, Change::Subsume, f, args))(
+            ctx
+        ),
+        "union" => parens(sequence3(text("union"), expr, expr))
+            .map(|((), e1, e2), span| Action::Union(span, e1, e2))(ctx),
+        "panic" => parens(sequence(text("panic"), string))
+            .map(|(_, msg), span| Action::Panic(span, msg))(ctx),
+        "extract" => choice(
+            parens(sequence(text("extract"), expr)).map(|((), expr), span| {
+                Action::Extract(span.clone(), expr, Expr::Lit(span, Literal::Int(0)))
+            }),
+            parens(sequence3(text("extract"), expr, expr))
+                .map(|((), expr, variants), span| Action::Extract(span, expr, variants)),
+        )(ctx),
+        _ => call_expr.map(|e, span| Action::Expr(span, e))(ctx),
+    }
+}
+
+fn fact(ctx: &Context) -> Res<Fact> {
+    let (call_expr, span, next) = call_expr(ctx)?;
+    match call_expr {
+        Expr::Call(_, head, ref tail) => {
+            let fact = match head.into() {
+                "=" if tail.len() < 2 => return Err(ParseError::EqFactLt2(span)),
+                "=" => Fact::Eq(span.clone(), tail.clone()),
+                _ => Fact::Fact(call_expr),
+            };
+            Ok((fact, span, next))
+        }
+        _ => unreachable!(),
+    }
+}
+
+fn schema(ctx: &Context) -> Res<Schema> {
+    sequence(list(r#type), r#type).map(|(input, output), _| Schema { input, output })(ctx)
+}
+
+fn expr(ctx: &Context) -> Res<Expr> {
+    choices!(
+        call_expr,
+        literal.map(|literal, span| Expr::Lit(span, literal)),
+        ident.map(|ident, span| Expr::Var(span, ident)),
+    )(ctx)
+}
+
+fn literal(ctx: &Context) -> Res<Literal> {
+    choices!(
+        sequence(text("("), text(")")).map(|((), ()), _| Literal::Unit),
+        num.map(|x, _| Literal::Int(x)),
+        r#f64.map(|x, _| Literal::F64(x)),
+        r#bool.map(|x, _| Literal::Bool(x)),
+        string.map(|x, _| Literal::String(x.into())),
+    )(ctx)
+}
+
+fn r#bool(ctx: &Context) -> Res<bool> {
+    let (_, span, next) = ident(ctx)?;
+    match span.string() {
+        "true" => Ok((true, span, next)),
+        "false" => Ok((false, span, next)),
+        _ => Err(ParseError::Bool(span)),
+    }
+}
+
+fn call_expr(ctx: &Context) -> Res<Expr> {
+    parens(sequence(ident, repeat_until_end_paren(expr)))
+        .map(|(head, tail), span| Expr::Call(span, head, tail))(ctx)
+}
+
+fn variant(ctx: &Context) -> Res<Variant> {
+    parens(sequence3(
+        ident,
+        repeat_until(r#type, |ctx| r#type(ctx).is_err()),
+        cost,
+    ))
+    .map(|(name, types, cost), span| Variant {
+        span,
+        name,
+        types,
+        cost,
+    })(ctx)
+}
+
+fn r#type(ctx: &Context) -> Res<Symbol> {
+    ident(ctx)
+}
+
+fn num(ctx: &Context) -> Res<i64> {
+    let (_, span, next) = ident(ctx)?;
+    match span.string().parse::<i64>() {
+        Ok(x) => Ok((x, span, next)),
+        Err(_) => Err(ParseError::Int(span)),
+    }
+}
+
+fn unum(ctx: &Context) -> Res<usize> {
+    let (_, span, next) = ident(ctx)?;
+    match span.string().parse::<usize>() {
+        Ok(x) => Ok((x, span, next)),
+        Err(_) => Err(ParseError::Int(span)),
+    }
+}
+
+fn r#f64(ctx: &Context) -> Res<OrderedFloat<f64>> {
+    use std::num::FpCategory::*;
+    let (_, span, next) = ident(ctx)?;
+    match span.string() {
+        "NaN" => Ok((OrderedFloat(f64::NAN), span, next)),
+        "inf" => Ok((OrderedFloat(f64::INFINITY), span, next)),
+        "-inf" => Ok((OrderedFloat(f64::NEG_INFINITY), span, next)),
+        _ => match span.string().parse::<f64>() {
+            Err(_) => Err(ParseError::Float(span)),
+            // Rust will parse "infinity" as a float, which we don't want
+            // we're only using `parse` to avoid implementing it ourselves anyway
+            Ok(x) => match x.classify() {
+                Nan | Infinite => Err(ParseError::Float(span)),
+                Zero | Subnormal | Normal => Ok((OrderedFloat(x), span, next)),
+            },
+        },
+    }
+}
+
+fn string(ctx: &Context) -> Res<String> {
+    let mut span = Span(ctx.source.clone(), ctx.index, ctx.index);
+    if ctx.current_char() != Some('"') {
+        return Err(ParseError::String(span));
+    }
+
+    let mut next = ctx.clone();
+    let mut in_escape = false;
+
+    next.advance_char();
+    loop {
+        match next.current_char() {
+            None => {
+                span.2 = next.index;
+                return Err(ParseError::MissingEndQuote(span));
+            }
+            Some('"') if !in_escape => break,
+            Some('\\') if !in_escape => in_escape = true,
+            Some(_) => in_escape = false,
+        }
+
+        next.advance_char();
+    }
+    next.advance_char();
+
+    span.2 = next.index;
+
+    next.advance_past_whitespace();
+
+    let s = span.string();
+    let s = &s[1..s.len() - 1];
+    Ok((s.to_string(), span, next))
+}
+
+#[derive(Debug, Error)]
+pub enum ParseError {
+    #[error("{0}\nexpected \"{1}\"")]
+    Text(Span, String),
+    #[error("{0}\nexpected string")]
+    String(Span),
+    #[error("{0}\nmissing end quote for string")]
+    MissingEndQuote(Span),
+    #[error("{0}\nunexpected end of file")]
+    EndOfFile(Span),
+    #[error("{0}\nexpected identifier")]
+    Ident(Span),
+    #[error("{0}\nexpected integer literal")]
+    Int(Span),
+    #[error("{0}\nexpected unsigned integer literal")]
+    Uint(Span),
+    #[error("{0}\nexpected floating point literal")]
+    Float(Span),
+    #[error("{0}\nexpected boolean literal")]
+    Bool(Span),
+    #[error("{0}\nusing = with less than two arguments is not allowed")]
+    EqFactLt2(Span),
+}
+
+#[cfg(test)]
+mod tests {
+    #[test]
+    fn test_parser_display_roundtrip() {
+        let s = r#"(f (g a 3) 4.0 (H "hello"))"#;
+        let e = crate::ast::parse_expr(None, s).unwrap();
+        assert_eq!(format!("{}", e), s);
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/ast/remove_globals.rs.html b/docs/src/egglog/ast/remove_globals.rs.html new file mode 100644 index 00000000..a68a4b9e --- /dev/null +++ b/docs/src/egglog/ast/remove_globals.rs.html @@ -0,0 +1,407 @@ +remove_globals.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+
//! Remove global variables from the program by translating
+//! them into functions with no arguments.
+//! This requires type information, so it is done after type checking.
+//! Primitives are translated into functions with a primitive output.
+//! When a globally-bound primitive value is used in the actions of a rule,
+//! we add a new variable to the query bound to the primitive value.
+
+use crate::*;
+use crate::{core::ResolvedCall, typechecking::FuncType};
+
+struct GlobalRemover<'a> {
+    fresh: &'a mut SymbolGen,
+}
+
+/// Removes all globals from a program.
+/// No top level lets are allowed after this pass,
+/// nor any variable that references a global.
+/// Adds new functions for global variables
+/// and replaces references to globals with
+/// references to the new functions.
+/// e.g.
+/// ```ignore
+/// (let x 3)
+/// (Add x x)
+/// ```
+/// becomes
+/// ```ignore
+/// (function x () i64)
+/// (set (x) 3)
+/// (Add (x) (x))
+/// ```
+///
+/// If later, this global is referenced in a rule:
+/// ```ignore
+/// (rule ((Neg y))
+///       ((Add x x)))
+/// ```
+/// We instrument the query to make the value available:
+/// ```ignore
+/// (rule ((Neg y)
+///        (= fresh_var_for_x (x)))
+///       ((Add fresh_var_for_x fresh_var_for_x)))
+/// ```
+pub(crate) fn remove_globals(
+    prog: Vec<ResolvedNCommand>,
+    fresh: &mut SymbolGen,
+) -> Vec<ResolvedNCommand> {
+    let mut remover = GlobalRemover { fresh };
+    prog.into_iter()
+        .flat_map(|cmd| remover.remove_globals_cmd(cmd))
+        .collect()
+}
+
+fn resolved_var_to_call(var: &ResolvedVar) -> ResolvedCall {
+    assert!(
+        var.is_global_ref,
+        "resolved_var_to_call called on non-global var"
+    );
+    ResolvedCall::Func(FuncType {
+        name: var.name,
+        input: vec![],
+        output: var.sort.clone(),
+        is_datatype: var.sort.is_eq_sort(),
+        has_default: false,
+    })
+}
+
+/// TODO (yz) it would be better to implement replace_global_var
+/// as a function from ResolvedVar to ResolvedExpr
+/// and use it as an argument to `subst` instead of `visit_expr`,
+/// but we have not implemented `subst` for command.
+fn replace_global_vars(expr: ResolvedExpr) -> ResolvedExpr {
+    match expr.get_global_var() {
+        Some(resolved_var) => {
+            GenericExpr::Call(expr.span(), resolved_var_to_call(&resolved_var), vec![])
+        }
+        None => expr,
+    }
+}
+
+fn remove_globals_expr(expr: ResolvedExpr) -> ResolvedExpr {
+    expr.visit_exprs(&mut replace_global_vars)
+}
+
+fn remove_globals_action(action: ResolvedAction) -> ResolvedAction {
+    action.visit_exprs(&mut replace_global_vars)
+}
+
+impl<'a> GlobalRemover<'a> {
+    fn remove_globals_cmd(&mut self, cmd: ResolvedNCommand) -> Vec<ResolvedNCommand> {
+        match cmd {
+            GenericNCommand::CoreAction(action) => match action {
+                GenericAction::Let(span, name, expr) => {
+                    let ty = expr.output_type();
+
+                    let func_decl = ResolvedFunctionDecl {
+                        name: name.name,
+                        schema: Schema {
+                            input: vec![],
+                            output: ty.name(),
+                        },
+                        default: None,
+                        merge: None,
+                        merge_action: GenericActions(vec![]),
+                        cost: None,
+                        unextractable: true,
+                        ignore_viz: true,
+                        span: span.clone(),
+                    };
+                    let resolved_call = ResolvedCall::Func(FuncType {
+                        name: name.name,
+                        input: vec![],
+                        is_datatype: ty.is_eq_sort(),
+                        output: ty.clone(),
+                        has_default: false,
+                    });
+                    vec![
+                        GenericNCommand::Function(func_decl),
+                        // output is eq-able, so generate a union
+                        if ty.is_eq_sort() {
+                            GenericNCommand::CoreAction(GenericAction::Union(
+                                span.clone(),
+                                GenericExpr::Call(span, resolved_call, vec![]),
+                                remove_globals_expr(expr),
+                            ))
+                        } else {
+                            GenericNCommand::CoreAction(GenericAction::Set(
+                                span,
+                                resolved_call,
+                                vec![],
+                                remove_globals_expr(expr),
+                            ))
+                        },
+                    ]
+                }
+                _ => vec![GenericNCommand::CoreAction(remove_globals_action(action))],
+            },
+            GenericNCommand::NormRule {
+                name,
+                ruleset,
+                rule,
+            } => {
+                // A map from the global variables in actions to their new names
+                // in the query.
+                let mut globals = HashMap::default();
+                rule.head.clone().visit_exprs(&mut |expr| {
+                    if let Some(resolved_var) = expr.get_global_var() {
+                        let new_name = self.fresh.fresh(&resolved_var.name);
+                        globals.insert(
+                            resolved_var.clone(),
+                            GenericExpr::Var(
+                                expr.span(),
+                                ResolvedVar {
+                                    name: new_name,
+                                    sort: resolved_var.sort.clone(),
+                                    is_global_ref: false,
+                                },
+                            ),
+                        );
+                    }
+                    expr
+                });
+                let new_facts: Vec<ResolvedFact> = globals
+                    .iter()
+                    .map(|(old, new)| {
+                        GenericFact::Eq(
+                            new.span(),
+                            vec![
+                                GenericExpr::Call(new.span(), resolved_var_to_call(old), vec![]),
+                                new.clone(),
+                            ],
+                        )
+                    })
+                    .collect();
+
+                let new_rule = GenericRule {
+                    span: rule.span,
+                    // instrument the old facts and add the new facts to the end
+                    body: rule
+                        .body
+                        .iter()
+                        .map(|fact| fact.clone().visit_exprs(&mut replace_global_vars))
+                        .chain(new_facts)
+                        .collect(),
+                    // replace references to globals with the newly bound names
+                    head: rule.head.clone().visit_exprs(&mut |expr| {
+                        if let Some(resolved_var) = expr.get_global_var() {
+                            globals.get(&resolved_var).unwrap().clone()
+                        } else {
+                            expr
+                        }
+                    }),
+                };
+                vec![GenericNCommand::NormRule {
+                    name,
+                    ruleset,
+                    rule: new_rule,
+                }]
+            }
+            _ => vec![cmd.visit_exprs(&mut replace_global_vars)],
+        }
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/constraint.rs.html b/docs/src/egglog/constraint.rs.html new file mode 100644 index 00000000..9fda63c9 --- /dev/null +++ b/docs/src/egglog/constraint.rs.html @@ -0,0 +1,1697 @@ +constraint.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+
use crate::{
+    ast::{
+        GenericAction, GenericActions, GenericExpr, GenericFact, MappedAction, ResolvedAction,
+        ResolvedActions, ResolvedExpr, ResolvedFact, ResolvedVar,
+    },
+    core::{
+        Atom, AtomTerm, CoreAction, CoreRule, GenericCoreActions, Query, ResolvedCall, SymbolOrEq,
+    },
+    sort::I64Sort,
+    typechecking::TypeError,
+    util::{FreshGen, HashSet, SymbolGen},
+    ArcSort, CorrespondingVar, Span, Symbol, TypeInfo, DUMMY_SPAN,
+};
+use core::{hash::Hash, panic};
+// Use immutable hashmap for performance
+// cloning assignments is common and O(1) with immutable hashmap
+use im_rc::HashMap;
+use std::{fmt::Debug, iter::once, mem::swap};
+
+#[derive(Clone, Debug)]
+pub enum ImpossibleConstraint {
+    ArityMismatch {
+        atom: Atom<Symbol>,
+        expected: usize,
+        actual: usize,
+    },
+    FunctionMismatch {
+        expected_output: ArcSort,
+        expected_input: Vec<ArcSort>,
+        actual_output: ArcSort,
+        actual_input: Vec<ArcSort>,
+    },
+}
+
+#[derive(Debug)]
+pub enum Constraint<Var, Value> {
+    Eq(Var, Var),
+    Assign(Var, Value),
+    And(Vec<Constraint<Var, Value>>),
+    // Exactly one of the constraints holds
+    // and all others are false
+    Xor(Vec<Constraint<Var, Value>>),
+    Impossible(ImpossibleConstraint),
+}
+
+pub enum ConstraintError<Var, Value> {
+    InconsistentConstraint(Var, Value, Value),
+    UnconstrainedVar(Var),
+    NoConstraintSatisfied(Vec<ConstraintError<Var, Value>>),
+    ImpossibleCaseIdentified(ImpossibleConstraint),
+}
+
+impl ConstraintError<AtomTerm, ArcSort> {
+    pub fn to_type_error(&self) -> TypeError {
+        match &self {
+            ConstraintError::InconsistentConstraint(x, v1, v2) => TypeError::Mismatch {
+                expr: x.to_expr(),
+                expected: v1.clone(),
+                actual: v2.clone(),
+            },
+            ConstraintError::UnconstrainedVar(v) => TypeError::InferenceFailure(v.to_expr()),
+            ConstraintError::NoConstraintSatisfied(constraints) => TypeError::AllAlternativeFailed(
+                constraints.iter().map(|c| c.to_type_error()).collect(),
+            ),
+            ConstraintError::ImpossibleCaseIdentified(ImpossibleConstraint::ArityMismatch {
+                atom,
+                expected,
+                actual,
+            }) => {
+                assert_eq!(*actual, atom.args.len() - 1);
+                TypeError::Arity {
+                    expr: atom.to_expr(),
+                    expected: *expected,
+                }
+            }
+            ConstraintError::ImpossibleCaseIdentified(ImpossibleConstraint::FunctionMismatch {
+                expected_output,
+                expected_input,
+                actual_output,
+                actual_input,
+            }) => TypeError::FunctionTypeMismatch(
+                expected_output.clone(),
+                expected_input.clone(),
+                actual_output.clone(),
+                actual_input.clone(),
+            ),
+        }
+    }
+}
+
+impl<Var, Value> Constraint<Var, Value>
+where
+    Var: Eq + PartialEq + Hash + Clone + Debug,
+    Value: Clone + Debug,
+{
+    /// Takes a partial assignment and update it based on the constraint.
+    /// If there's a conflict, returns the conflicting variable, the assigned conflicting types.
+    /// Otherwise, return whether the assignment is updated.
+    fn update<K: Eq>(
+        &self,
+        assignment: &mut Assignment<Var, Value>,
+        key: impl Fn(&Value) -> K + Copy,
+    ) -> Result<bool, ConstraintError<Var, Value>> {
+        match self {
+            Constraint::Eq(x, y) => match (assignment.0.get(x), assignment.0.get(y)) {
+                (Some(value), None) => {
+                    assignment.insert(y.clone(), value.clone());
+                    Ok(true)
+                }
+                (None, Some(value)) => {
+                    assignment.insert(x.clone(), value.clone());
+                    Ok(true)
+                }
+                (Some(v1), Some(v2)) => {
+                    if key(v1) == key(v2) {
+                        Ok(false)
+                    } else {
+                        Err(ConstraintError::InconsistentConstraint(
+                            x.clone(),
+                            v1.clone(),
+                            v2.clone(),
+                        ))
+                    }
+                }
+                (None, None) => Ok(false),
+            },
+            Constraint::Assign(x, v) => match assignment.0.get(x) {
+                None => {
+                    assignment.insert(x.clone(), v.clone());
+                    Ok(true)
+                }
+                Some(value) => {
+                    if key(value) == key(v) {
+                        Ok(false)
+                    } else {
+                        Err(ConstraintError::InconsistentConstraint(
+                            x.clone(),
+                            v.clone(),
+                            value.clone(),
+                        ))
+                    }
+                }
+            },
+            Constraint::Xor(cs) => {
+                let mut success_count = 0;
+                let orig_assignment = assignment.clone();
+                let mut result_assignment = assignment.clone();
+                let mut assignment_updated = false;
+                let mut errors = vec![];
+                for c in cs {
+                    let result = c.update(assignment, key);
+                    match result {
+                        Ok(updated) => {
+                            success_count += 1;
+                            if success_count > 1 {
+                                break;
+                            }
+
+                            if updated {
+                                swap(&mut result_assignment, assignment);
+                            }
+                            assignment_updated = updated;
+                        }
+                        Err(error) => errors.push(error),
+                    }
+                }
+                // If update is successful for only one sub constraint, then we have nailed down the only true constraint.
+                // If update is successful for more than one constraint, then Xor succeeds with no updates.
+                // If update fails for every constraint, then Xor fails
+                match success_count.cmp(&1) {
+                    std::cmp::Ordering::Equal => {
+                        *assignment = result_assignment;
+                        Ok(assignment_updated)
+                    }
+                    std::cmp::Ordering::Greater => {
+                        *assignment = orig_assignment;
+                        Ok(false)
+                    }
+                    std::cmp::Ordering::Less => Err(ConstraintError::NoConstraintSatisfied(errors)),
+                }
+            }
+            Constraint::Impossible(constraint) => Err(ConstraintError::ImpossibleCaseIdentified(
+                constraint.clone(),
+            )),
+            Constraint::And(cs) => {
+                let orig_assignment = assignment.clone();
+                let mut updated = false;
+                for c in cs {
+                    match c.update(assignment, key) {
+                        Ok(upd) => updated |= upd,
+                        Err(error) => {
+                            // In the case of failure,
+                            // we need to restore the assignment
+                            *assignment = orig_assignment;
+                            return Err(error);
+                        }
+                    }
+                }
+                Ok(updated)
+            }
+        }
+    }
+}
+
+#[derive(Debug)]
+pub struct Problem<Var, Value> {
+    pub constraints: Vec<Constraint<Var, Value>>,
+    pub range: HashSet<Var>,
+}
+
+impl Default for Problem<AtomTerm, ArcSort> {
+    fn default() -> Self {
+        Self {
+            constraints: vec![],
+            range: HashSet::default(),
+        }
+    }
+}
+
+#[derive(Clone)]
+pub(crate) struct Assignment<Var, Value>(pub HashMap<Var, Value>);
+
+impl<Var, Value> Assignment<Var, Value>
+where
+    Var: Hash + Eq + PartialEq + Clone,
+    Value: Clone,
+{
+    pub fn insert(&mut self, var: Var, value: Value) -> Option<Value> {
+        self.0.insert(var, value)
+    }
+
+    pub fn get(&self, var: &Var) -> Option<&Value> {
+        self.0.get(var)
+    }
+}
+
+impl Assignment<AtomTerm, ArcSort> {
+    pub(crate) fn annotate_expr(
+        &self,
+        expr: &GenericExpr<CorrespondingVar<Symbol, Symbol>, Symbol>,
+        typeinfo: &TypeInfo,
+    ) -> ResolvedExpr {
+        match &expr {
+            GenericExpr::Lit(span, literal) => ResolvedExpr::Lit(span.clone(), literal.clone()),
+            GenericExpr::Var(span, var) => {
+                let global_ty = typeinfo.lookup_global(var);
+                let ty = global_ty
+                    .clone()
+                    // Span is ignored when looking up atom_terms
+                    .or_else(|| self.get(&AtomTerm::Var(DUMMY_SPAN.clone(), *var)).cloned())
+                    .expect("All variables should be assigned before annotation");
+                ResolvedExpr::Var(
+                    span.clone(),
+                    ResolvedVar {
+                        name: *var,
+                        sort: ty.clone(),
+                        is_global_ref: global_ty.is_some(),
+                    },
+                )
+            }
+            GenericExpr::Call(
+                span,
+                CorrespondingVar {
+                    head,
+                    to: corresponding_var,
+                },
+                args,
+            ) => {
+                // get the resolved call using resolve_rule
+                let args: Vec<_> = args
+                    .iter()
+                    .map(|arg| self.annotate_expr(arg, typeinfo))
+                    .collect();
+                let types: Vec<_> = args
+                    .iter()
+                    .map(|arg| arg.output_type())
+                    .chain(once(
+                        self.get(&AtomTerm::Var(DUMMY_SPAN.clone(), *corresponding_var))
+                            .unwrap()
+                            .clone(),
+                    ))
+                    .collect();
+                let resolved_call = ResolvedCall::from_resolution(head, &types, typeinfo);
+                GenericExpr::Call(span.clone(), resolved_call, args)
+            }
+        }
+    }
+
+    pub(crate) fn annotate_fact(
+        &self,
+        facts: &GenericFact<CorrespondingVar<Symbol, Symbol>, Symbol>,
+        typeinfo: &TypeInfo,
+    ) -> ResolvedFact {
+        match facts {
+            GenericFact::Eq(span, facts) => ResolvedFact::Eq(
+                span.clone(),
+                facts
+                    .iter()
+                    .map(|expr| self.annotate_expr(expr, typeinfo))
+                    .collect(),
+            ),
+            GenericFact::Fact(expr) => ResolvedFact::Fact(self.annotate_expr(expr, typeinfo)),
+        }
+    }
+
+    pub(crate) fn annotate_facts(
+        &self,
+        mapped_facts: &[GenericFact<CorrespondingVar<Symbol, Symbol>, Symbol>],
+        typeinfo: &TypeInfo,
+    ) -> Vec<ResolvedFact> {
+        mapped_facts
+            .iter()
+            .map(|fact| self.annotate_fact(fact, typeinfo))
+            .collect()
+    }
+
+    pub(crate) fn annotate_action(
+        &self,
+        action: &MappedAction,
+        typeinfo: &TypeInfo,
+    ) -> Result<ResolvedAction, TypeError> {
+        match action {
+            GenericAction::Let(span, var, expr) => {
+                let ty = self
+                    .get(&AtomTerm::Var(span.clone(), *var))
+                    .expect("All variables should be assigned before annotation");
+                Ok(ResolvedAction::Let(
+                    span.clone(),
+                    ResolvedVar {
+                        name: *var,
+                        sort: ty.clone(),
+                        is_global_ref: false,
+                    },
+                    self.annotate_expr(expr, typeinfo),
+                ))
+            }
+            // Note mapped_var for set is a dummy variable that does not mean anything
+            GenericAction::Set(
+                span,
+                CorrespondingVar {
+                    head,
+                    to: _mapped_var,
+                },
+                children,
+                rhs,
+            ) => {
+                let children: Vec<_> = children
+                    .iter()
+                    .map(|child| self.annotate_expr(child, typeinfo))
+                    .collect();
+                let rhs = self.annotate_expr(rhs, typeinfo);
+                let types: Vec<_> = children
+                    .iter()
+                    .map(|child| child.output_type())
+                    .chain(once(rhs.output_type()))
+                    .collect();
+                let resolved_call = ResolvedCall::from_resolution(head, &types, typeinfo);
+                if !matches!(resolved_call, ResolvedCall::Func(_)) {
+                    return Err(TypeError::UnboundFunction(*head, span.clone()));
+                }
+                Ok(ResolvedAction::Set(
+                    span.clone(),
+                    resolved_call,
+                    children,
+                    rhs,
+                ))
+            }
+            // Note mapped_var for delete is a dummy variable that does not mean anything
+            GenericAction::Change(
+                span,
+                change,
+                CorrespondingVar {
+                    head,
+                    to: _mapped_var,
+                },
+                children,
+            ) => {
+                let children: Vec<_> = children
+                    .iter()
+                    .map(|child| self.annotate_expr(child, typeinfo))
+                    .collect();
+                let types: Vec<_> = children.iter().map(|child| child.output_type()).collect();
+                let resolved_call =
+                    ResolvedCall::from_resolution_func_types(head, &types, typeinfo)
+                        .ok_or_else(|| TypeError::UnboundFunction(*head, span.clone()))?;
+                Ok(ResolvedAction::Change(
+                    span.clone(),
+                    *change,
+                    resolved_call,
+                    children.clone(),
+                ))
+            }
+            GenericAction::Union(span, lhs, rhs) => Ok(ResolvedAction::Union(
+                span.clone(),
+                self.annotate_expr(lhs, typeinfo),
+                self.annotate_expr(rhs, typeinfo),
+            )),
+            GenericAction::Extract(span, lhs, rhs) => Ok(ResolvedAction::Extract(
+                span.clone(),
+                self.annotate_expr(lhs, typeinfo),
+                self.annotate_expr(rhs, typeinfo),
+            )),
+            GenericAction::Panic(span, msg) => Ok(ResolvedAction::Panic(span.clone(), msg.clone())),
+            GenericAction::Expr(span, expr) => Ok(ResolvedAction::Expr(
+                span.clone(),
+                self.annotate_expr(expr, typeinfo),
+            )),
+        }
+    }
+
+    pub(crate) fn annotate_actions(
+        &self,
+        mapped_actions: &GenericActions<CorrespondingVar<Symbol, Symbol>, Symbol>,
+        typeinfo: &TypeInfo,
+    ) -> Result<ResolvedActions, TypeError> {
+        let actions = mapped_actions
+            .iter()
+            .map(|action| self.annotate_action(action, typeinfo))
+            .collect::<Result<_, _>>()?;
+
+        Ok(ResolvedActions::new(actions))
+    }
+}
+
+impl<Var, Value> Problem<Var, Value>
+where
+    Var: Eq + PartialEq + Hash + Clone + Debug,
+    Value: Clone + Debug,
+{
+    pub(crate) fn solve<K: Eq + Debug>(
+        &self,
+        key: impl Fn(&Value) -> K + Copy,
+    ) -> Result<Assignment<Var, Value>, ConstraintError<Var, Value>> {
+        let mut assignment = Assignment(HashMap::default());
+        let mut changed = true;
+        while changed {
+            changed = false;
+            for constraint in self.constraints.iter() {
+                changed |= constraint.update(&mut assignment, key)?;
+            }
+        }
+
+        for v in self.range.iter() {
+            if !assignment.0.contains_key(v) {
+                return Err(ConstraintError::UnconstrainedVar(v.clone()));
+            }
+        }
+        Ok(assignment)
+    }
+
+    pub(crate) fn add_binding(&mut self, var: Var, clone: Value) {
+        self.constraints.push(Constraint::Assign(var, clone));
+    }
+}
+
+impl Problem<AtomTerm, ArcSort> {
+    pub(crate) fn add_query(
+        &mut self,
+        query: &Query<SymbolOrEq, Symbol>,
+        typeinfo: &TypeInfo,
+    ) -> Result<(), TypeError> {
+        self.constraints.extend(query.get_constraints(typeinfo)?);
+        self.range.extend(query.atom_terms());
+        Ok(())
+    }
+
+    pub fn add_actions(
+        &mut self,
+        actions: &GenericCoreActions<Symbol, Symbol>,
+        typeinfo: &TypeInfo,
+        symbol_gen: &mut SymbolGen,
+    ) -> Result<(), TypeError> {
+        for action in actions.0.iter() {
+            self.constraints
+                .extend(action.get_constraints(typeinfo, symbol_gen)?);
+
+            // bound vars are added to range
+            match action {
+                CoreAction::Let(span, var, _, _) => {
+                    self.range.insert(AtomTerm::Var(span.clone(), *var));
+                }
+                CoreAction::LetAtomTerm(span, v, _) => {
+                    self.range.insert(AtomTerm::Var(span.clone(), *v));
+                }
+                _ => (),
+            }
+        }
+        Ok(())
+    }
+
+    pub(crate) fn add_rule(
+        &mut self,
+        rule: &CoreRule,
+        typeinfo: &TypeInfo,
+        symbol_gen: &mut SymbolGen,
+    ) -> Result<(), TypeError> {
+        let CoreRule {
+            span: _,
+            head,
+            body,
+        } = rule;
+        self.add_query(body, typeinfo)?;
+        self.add_actions(head, typeinfo, symbol_gen)?;
+        Ok(())
+    }
+
+    pub(crate) fn assign_local_var_type(
+        &mut self,
+        var: Symbol,
+        span: Span,
+        sort: ArcSort,
+    ) -> Result<(), TypeError> {
+        self.add_binding(AtomTerm::Var(span.clone(), var), sort);
+        self.range.insert(AtomTerm::Var(span, var));
+        Ok(())
+    }
+}
+
+impl CoreAction {
+    pub(crate) fn get_constraints(
+        &self,
+        typeinfo: &TypeInfo,
+        symbol_gen: &mut SymbolGen,
+    ) -> Result<Vec<Constraint<AtomTerm, ArcSort>>, TypeError> {
+        match self {
+            CoreAction::Let(span, symbol, f, args) => {
+                let mut args = args.clone();
+                args.push(AtomTerm::Var(span.clone(), *symbol));
+
+                Ok(get_literal_and_global_constraints(&args, typeinfo)
+                    .chain(get_atom_application_constraints(f, &args, span, typeinfo)?)
+                    .collect())
+            }
+            CoreAction::Set(span, head, args, rhs) => {
+                let mut args = args.clone();
+                args.push(rhs.clone());
+
+                Ok(get_literal_and_global_constraints(&args, typeinfo)
+                    .chain(get_atom_application_constraints(
+                        head, &args, span, typeinfo,
+                    )?)
+                    .collect())
+            }
+            CoreAction::Change(span, _change, head, args) => {
+                let mut args = args.clone();
+                // Add a dummy last output argument
+                let var = symbol_gen.fresh(head);
+                args.push(AtomTerm::Var(span.clone(), var));
+
+                Ok(get_literal_and_global_constraints(&args, typeinfo)
+                    .chain(get_atom_application_constraints(
+                        head, &args, span, typeinfo,
+                    )?)
+                    .collect())
+            }
+            CoreAction::Union(_ann, lhs, rhs) => Ok(get_literal_and_global_constraints(
+                &[lhs.clone(), rhs.clone()],
+                typeinfo,
+            )
+            .chain(once(Constraint::Eq(lhs.clone(), rhs.clone())))
+            .collect()),
+            CoreAction::Extract(_ann, e, n) => {
+                // e can be anything
+                Ok(
+                    get_literal_and_global_constraints(&[e.clone(), n.clone()], typeinfo)
+                        .chain(once(Constraint::Assign(
+                            n.clone(),
+                            std::sync::Arc::new(I64Sort) as ArcSort,
+                        )))
+                        .collect(),
+                )
+            }
+            CoreAction::Panic(_ann, _) => Ok(vec![]),
+            CoreAction::LetAtomTerm(span, v, at) => {
+                Ok(get_literal_and_global_constraints(&[at.clone()], typeinfo)
+                    .chain(once(Constraint::Eq(
+                        AtomTerm::Var(span.clone(), *v),
+                        at.clone(),
+                    )))
+                    .collect())
+            }
+        }
+    }
+}
+
+impl Atom<SymbolOrEq> {
+    pub fn get_constraints(
+        &self,
+        type_info: &TypeInfo,
+    ) -> Result<Vec<Constraint<AtomTerm, ArcSort>>, TypeError> {
+        let literal_constraints = get_literal_and_global_constraints(&self.args, type_info);
+        match &self.head {
+            SymbolOrEq::Eq => {
+                assert_eq!(self.args.len(), 2);
+                let constraints = literal_constraints
+                    .chain(once(Constraint::Eq(
+                        self.args[0].clone(),
+                        self.args[1].clone(),
+                    )))
+                    .collect();
+                Ok(constraints)
+            }
+            SymbolOrEq::Symbol(head) => Ok(literal_constraints
+                .chain(get_atom_application_constraints(
+                    head, &self.args, &self.span, type_info,
+                )?)
+                .collect()),
+        }
+    }
+}
+
+fn get_atom_application_constraints(
+    head: &Symbol,
+    args: &[AtomTerm],
+    span: &Span,
+    type_info: &TypeInfo,
+) -> Result<Vec<Constraint<AtomTerm, ArcSort>>, TypeError> {
+    // An atom can have potentially different semantics due to polymorphism
+    // e.g. (set-empty) can mean any empty set with some element type.
+    // To handle this, we collect each possible instantiations of an atom
+    // (where each instantiation is a vec of constraints, thus vec of vec)
+    // into `xor_constraints`.
+    // `Constraint::Xor` means one and only one of the instantiation can hold.
+    let mut xor_constraints: Vec<Vec<Constraint<AtomTerm, ArcSort>>> = vec![];
+
+    // function atom constraints
+    if let Some(typ) = type_info.func_types.get(head) {
+        let mut constraints = vec![];
+        // arity mismatch
+        if typ.input.len() + 1 != args.len() {
+            constraints.push(Constraint::Impossible(
+                ImpossibleConstraint::ArityMismatch {
+                    atom: Atom {
+                        span: span.clone(),
+                        head: *head,
+                        args: args.to_vec(),
+                    },
+                    expected: typ.input.len(),
+                    actual: args.len() - 1,
+                },
+            ));
+        } else {
+            for (arg_typ, arg) in typ
+                .input
+                .iter()
+                .cloned()
+                .chain(once(typ.output.clone()))
+                .zip(args.iter().cloned())
+            {
+                constraints.push(Constraint::Assign(arg, arg_typ));
+            }
+        }
+        xor_constraints.push(constraints);
+    }
+
+    // primitive atom constraints
+    if let Some(primitives) = type_info.primitives.get(head) {
+        for p in primitives {
+            let constraints = p.get_type_constraints(span).get(args, type_info);
+            xor_constraints.push(constraints);
+        }
+    }
+
+    // do literal and global variable constraints first
+    // as they are the most "informative"
+    match xor_constraints.len() {
+        0 => Err(TypeError::UnboundFunction(*head, span.clone())),
+        1 => Ok(xor_constraints.pop().unwrap()),
+        _ => Ok(vec![Constraint::Xor(
+            xor_constraints.into_iter().map(Constraint::And).collect(),
+        )]),
+    }
+}
+
+fn get_literal_and_global_constraints<'a>(
+    args: &'a [AtomTerm],
+    type_info: &'a TypeInfo,
+) -> impl Iterator<Item = Constraint<AtomTerm, ArcSort>> + 'a {
+    args.iter().filter_map(|arg| {
+        match arg {
+            AtomTerm::Var(_, _) => None,
+            // Literal to type constraint
+            AtomTerm::Literal(_, lit) => {
+                let typ = crate::sort::literal_sort(lit);
+                Some(Constraint::Assign(arg.clone(), typ))
+            }
+            AtomTerm::Global(_, v) => {
+                if let Some(typ) = type_info.lookup_global(v) {
+                    Some(Constraint::Assign(arg.clone(), typ.clone()))
+                } else {
+                    panic!("All global variables should be bound before type checking")
+                }
+            }
+        }
+    })
+}
+
+pub trait TypeConstraint {
+    fn get(
+        &self,
+        arguments: &[AtomTerm],
+        typeinfo: &TypeInfo,
+    ) -> Vec<Constraint<AtomTerm, ArcSort>>;
+}
+
+/// Construct a set of `Assign` constraints that fully constrain the type of arguments
+pub struct SimpleTypeConstraint {
+    name: Symbol,
+    sorts: Vec<ArcSort>,
+    span: Span,
+}
+
+impl SimpleTypeConstraint {
+    pub fn new(name: Symbol, sorts: Vec<ArcSort>, span: Span) -> SimpleTypeConstraint {
+        SimpleTypeConstraint { name, sorts, span }
+    }
+
+    pub fn into_box(self) -> Box<dyn TypeConstraint> {
+        Box::new(self)
+    }
+}
+
+impl TypeConstraint for SimpleTypeConstraint {
+    fn get(
+        &self,
+        arguments: &[AtomTerm],
+        _typeinfo: &TypeInfo,
+    ) -> Vec<Constraint<AtomTerm, ArcSort>> {
+        if arguments.len() != self.sorts.len() {
+            vec![Constraint::Impossible(
+                ImpossibleConstraint::ArityMismatch {
+                    atom: Atom {
+                        span: self.span.clone(),
+                        head: self.name,
+                        args: arguments.to_vec(),
+                    },
+                    expected: self.sorts.len(),
+                    actual: arguments.len(),
+                },
+            )]
+        } else {
+            arguments
+                .iter()
+                .cloned()
+                .zip(self.sorts.iter().cloned())
+                .map(|(arg, sort)| Constraint::Assign(arg, sort))
+                .collect()
+        }
+    }
+}
+
+/// This constraint requires all types to be equivalent to each other
+pub struct AllEqualTypeConstraint {
+    name: Symbol,
+    sort: Option<ArcSort>,
+    exact_length: Option<usize>,
+    output: Option<ArcSort>,
+    span: Span,
+}
+
+impl AllEqualTypeConstraint {
+    pub fn new(name: Symbol, span: Span) -> AllEqualTypeConstraint {
+        AllEqualTypeConstraint {
+            name,
+            sort: None,
+            exact_length: None,
+            output: None,
+            span,
+        }
+    }
+
+    pub fn into_box(self) -> Box<dyn TypeConstraint> {
+        Box::new(self)
+    }
+
+    /// Requires all arguments to have the given sort.
+    /// If `with_output_sort` is not specified, this requirement
+    /// also applies to the output argument.
+    pub fn with_all_arguments_sort(mut self, sort: ArcSort) -> Self {
+        self.sort = Some(sort);
+        self
+    }
+
+    /// Requires the length of arguments to be `exact_length`.
+    /// Note this includes both input arguments and output argument.
+    pub fn with_exact_length(mut self, exact_length: usize) -> Self {
+        self.exact_length = Some(exact_length);
+        self
+    }
+
+    /// Requires the output argument to have the given sort.
+    pub fn with_output_sort(mut self, output_sort: ArcSort) -> Self {
+        self.output = Some(output_sort);
+        self
+    }
+}
+
+impl TypeConstraint for AllEqualTypeConstraint {
+    fn get(
+        &self,
+        mut arguments: &[AtomTerm],
+        _typeinfo: &TypeInfo,
+    ) -> Vec<Constraint<AtomTerm, ArcSort>> {
+        if arguments.is_empty() {
+            panic!("all arguments should have length > 0")
+        }
+
+        match self.exact_length {
+            Some(exact_length) if exact_length != arguments.len() => {
+                return vec![Constraint::Impossible(
+                    ImpossibleConstraint::ArityMismatch {
+                        atom: Atom {
+                            span: self.span.clone(),
+                            head: self.name,
+                            args: arguments.to_vec(),
+                        },
+                        expected: exact_length,
+                        actual: arguments.len(),
+                    },
+                )]
+            }
+            _ => (),
+        }
+
+        let mut constraints = vec![];
+        if let Some(output) = self.output.clone() {
+            let (out, inputs) = arguments.split_last().unwrap();
+            constraints.push(Constraint::Assign(out.clone(), output));
+            arguments = inputs;
+        }
+
+        if let Some(sort) = self.sort.clone() {
+            constraints.extend(
+                arguments
+                    .iter()
+                    .cloned()
+                    .map(|arg| Constraint::Assign(arg, sort.clone())),
+            )
+        } else if let Some((first, rest)) = arguments.split_first() {
+            constraints.extend(
+                rest.iter()
+                    .cloned()
+                    .map(|arg| Constraint::Eq(arg, first.clone())),
+            );
+        }
+        constraints
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/core.rs.html b/docs/src/egglog/core.rs.html new file mode 100644 index 00000000..e909bfb0 --- /dev/null +++ b/docs/src/egglog/core.rs.html @@ -0,0 +1,1703 @@ +core.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+
//! This file implements the core IR of the language, which is called CoreRule.
+//! CoreRule uses a conjunctive query-like IR for the body (queries) and a
+//! SSA-like IR for the head (actions) based on the previous CoreAction form.
+//! Every construct has two forms: a standard (unresolved) form and a resolved form,
+//! which differs in whether the head is a symbol or a resolved call.
+//! Currently, CoreRule has several usages:
+//!   Typechecking is done over CoreRule format
+//!   Canonicalization is done over CoreRule format
+//!   ActionCompilers further compiles core actions to programs in a small VM
+//!   GJ compiler further compiler core queries to gj's CompiledQueries
+//!
+//! Most compiler-time optimizations are expected to be done over CoreRule format.
+use std::hash::Hasher;
+use std::ops::AddAssign;
+
+use crate::{typechecking::FuncType, HashMap, *};
+use typechecking::TypeError;
+
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub(crate) enum HeadOrEq<Head> {
+    Symbol(Head),
+    Eq,
+}
+
+pub(crate) type SymbolOrEq = HeadOrEq<Symbol>;
+
+impl From<Symbol> for SymbolOrEq {
+    fn from(value: Symbol) -> Self {
+        SymbolOrEq::Symbol(value)
+    }
+}
+
+impl<Head> HeadOrEq<Head> {
+    pub fn is_eq(&self) -> bool {
+        matches!(self, HeadOrEq::Eq)
+    }
+}
+
+#[derive(Debug, Clone)]
+pub(crate) struct SpecializedPrimitive {
+    pub(crate) primitive: Primitive,
+    pub(crate) input: Vec<ArcSort>,
+    pub(crate) output: ArcSort,
+}
+
+#[derive(Debug, Clone)]
+pub(crate) enum ResolvedCall {
+    Func(FuncType),
+    Primitive(SpecializedPrimitive),
+}
+
+impl SymbolLike for ResolvedCall {
+    fn to_symbol(&self) -> Symbol {
+        match self {
+            ResolvedCall::Func(f) => f.name,
+            ResolvedCall::Primitive(prim) => prim.primitive.0.name(),
+        }
+    }
+}
+
+impl ResolvedCall {
+    pub fn output(&self) -> &ArcSort {
+        match self {
+            ResolvedCall::Func(func) => &func.output,
+            ResolvedCall::Primitive(prim) => &prim.output,
+        }
+    }
+
+    // Different from `from_resolution`, this function only considers function types and not primitives.
+    // As a result, it only requires input argument types, so types.len() == func.input.len(),
+    // while for `from_resolution`, types.len() == func.input.len() + 1 to account for the output type
+    pub fn from_resolution_func_types(
+        head: &Symbol,
+        types: &[ArcSort],
+        typeinfo: &TypeInfo,
+    ) -> Option<ResolvedCall> {
+        if let Some(ty) = typeinfo.func_types.get(head) {
+            // As long as input types match, a result is returned.
+            let expected = ty.input.iter().map(|s| s.name());
+            let actual = types.iter().map(|s| s.name());
+            if expected.eq(actual) {
+                return Some(ResolvedCall::Func(ty.clone()));
+            }
+        }
+        None
+    }
+
+    pub fn from_resolution(head: &Symbol, types: &[ArcSort], typeinfo: &TypeInfo) -> ResolvedCall {
+        let mut resolved_call = Vec::with_capacity(1);
+        if let Some(ty) = typeinfo.func_types.get(head) {
+            let expected = ty.input.iter().chain(once(&ty.output)).map(|s| s.name());
+            let actual = types.iter().map(|s| s.name());
+            if expected.eq(actual) {
+                resolved_call.push(ResolvedCall::Func(ty.clone()));
+            }
+        }
+
+        if let Some(primitives) = typeinfo.primitives.get(head) {
+            for primitive in primitives {
+                if primitive.accept(types, typeinfo) {
+                    let (out, inp) = types.split_last().unwrap();
+                    resolved_call.push(ResolvedCall::Primitive(SpecializedPrimitive {
+                        primitive: primitive.clone(),
+                        input: inp.to_vec(),
+                        output: out.clone(),
+                    }));
+                }
+            }
+        }
+        assert!(
+            resolved_call.len() == 1,
+            "Ambiguous resolution for {:?}",
+            head,
+        );
+        resolved_call.pop().unwrap()
+    }
+}
+
+impl Display for ResolvedCall {
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        match self {
+            ResolvedCall::Func(func) => write!(f, "{}", func.name),
+            ResolvedCall::Primitive(prim) => write!(f, "{}", prim.primitive.0.name()),
+        }
+    }
+}
+
+impl ToSexp for ResolvedCall {
+    fn to_sexp(&self) -> Sexp {
+        Sexp::Symbol(self.to_string())
+    }
+}
+
+#[derive(Debug, Clone)]
+pub enum GenericAtomTerm<Leaf> {
+    Var(Span, Leaf),
+    Literal(Span, Literal),
+    Global(Span, Leaf),
+}
+
+// Ignores annotations for equality and hasing
+impl<Leaf> PartialEq for GenericAtomTerm<Leaf>
+where
+    Leaf: PartialEq,
+{
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (GenericAtomTerm::Var(_, v1), GenericAtomTerm::Var(_, v2)) => v1 == v2,
+            (GenericAtomTerm::Literal(_, l1), GenericAtomTerm::Literal(_, l2)) => l1 == l2,
+            (GenericAtomTerm::Global(_, g1), GenericAtomTerm::Global(_, g2)) => g1 == g2,
+            _ => false,
+        }
+    }
+}
+
+impl<Leaf> Eq for GenericAtomTerm<Leaf> where Leaf: Eq {}
+
+impl<Leaf> Hash for GenericAtomTerm<Leaf>
+where
+    Leaf: Hash,
+{
+    fn hash<H: Hasher>(&self, state: &mut H) {
+        match self {
+            GenericAtomTerm::Var(_, v) => v.hash(state),
+            GenericAtomTerm::Literal(_, l) => l.hash(state),
+            GenericAtomTerm::Global(_, g) => g.hash(state),
+        }
+    }
+}
+
+pub type AtomTerm = GenericAtomTerm<Symbol>;
+pub type ResolvedAtomTerm = GenericAtomTerm<ResolvedVar>;
+
+impl<Leaf> GenericAtomTerm<Leaf> {
+    pub fn span(&self) -> &Span {
+        match self {
+            GenericAtomTerm::Var(span, _) => span,
+            GenericAtomTerm::Literal(span, _) => span,
+            GenericAtomTerm::Global(span, _) => span,
+        }
+    }
+}
+
+impl<Leaf: Clone> GenericAtomTerm<Leaf> {
+    pub fn to_expr<Head>(&self) -> GenericExpr<Head, Leaf> {
+        match self {
+            GenericAtomTerm::Var(span, v) => GenericExpr::Var(span.clone(), v.clone()),
+            GenericAtomTerm::Literal(span, l) => GenericExpr::Lit(span.clone(), l.clone()),
+            GenericAtomTerm::Global(span, v) => GenericExpr::Var(span.clone(), v.clone()),
+        }
+    }
+}
+
+impl ResolvedAtomTerm {
+    pub fn output(&self) -> ArcSort {
+        match self {
+            ResolvedAtomTerm::Var(_, v) => v.sort.clone(),
+            ResolvedAtomTerm::Literal(_, l) => literal_sort(l),
+            ResolvedAtomTerm::Global(_, v) => v.sort.clone(),
+        }
+    }
+}
+
+impl std::fmt::Display for AtomTerm {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        match self {
+            AtomTerm::Var(_, v) => write!(f, "{v}"),
+            AtomTerm::Literal(_, lit) => write!(f, "{lit}"),
+            AtomTerm::Global(_, g) => write!(f, "{g}"),
+        }
+    }
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub struct GenericAtom<Head, Leaf> {
+    pub span: Span,
+    pub head: Head,
+    pub args: Vec<GenericAtomTerm<Leaf>>,
+}
+
+pub type Atom<T> = GenericAtom<T, Symbol>;
+
+impl<T: std::fmt::Display> std::fmt::Display for Atom<T> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(f, "({} {}) ", self.head, ListDisplay(&self.args, " "))
+    }
+}
+
+impl<Head, Leaf> GenericAtom<Head, Leaf>
+where
+    Leaf: Clone + Eq + Hash,
+    Head: Clone,
+{
+    pub fn vars(&self) -> impl Iterator<Item = Leaf> + '_ {
+        self.args.iter().filter_map(|t| match t {
+            GenericAtomTerm::Var(_, v) => Some(v.clone()),
+            GenericAtomTerm::Literal(..) => None,
+            GenericAtomTerm::Global(..) => None,
+        })
+    }
+
+    fn subst(&mut self, subst: &HashMap<Leaf, GenericAtomTerm<Leaf>>) {
+        for arg in self.args.iter_mut() {
+            match arg {
+                GenericAtomTerm::Var(_, v) => {
+                    if let Some(at) = subst.get(v) {
+                        *arg = at.clone();
+                    }
+                }
+                GenericAtomTerm::Literal(..) => (),
+                GenericAtomTerm::Global(..) => (),
+            }
+        }
+    }
+}
+impl Atom<Symbol> {
+    pub(crate) fn to_expr(&self) -> Expr {
+        let n = self.args.len();
+        Expr::Call(
+            self.span.clone(),
+            self.head,
+            self.args[0..n - 1]
+                .iter()
+                .map(|arg| arg.to_expr())
+                .collect(),
+        )
+    }
+}
+
+#[derive(Debug, Clone)]
+pub struct Query<Head, Leaf> {
+    pub atoms: Vec<GenericAtom<Head, Leaf>>,
+}
+
+impl<Head, Leaf> Default for Query<Head, Leaf> {
+    fn default() -> Self {
+        Self {
+            atoms: Default::default(),
+        }
+    }
+}
+
+impl Query<SymbolOrEq, Symbol> {
+    pub fn get_constraints(
+        &self,
+        type_info: &TypeInfo,
+    ) -> Result<Vec<Constraint<AtomTerm, ArcSort>>, TypeError> {
+        let mut constraints = vec![];
+        for atom in self.atoms.iter() {
+            constraints.extend(atom.get_constraints(type_info)?.into_iter());
+        }
+        Ok(constraints)
+    }
+
+    pub(crate) fn atom_terms(&self) -> HashSet<AtomTerm> {
+        self.atoms
+            .iter()
+            .flat_map(|atom| atom.args.iter().cloned())
+            .collect()
+    }
+}
+
+impl<Head, Leaf> Query<Head, Leaf>
+where
+    Leaf: Eq + Clone + Hash,
+    Head: Clone,
+{
+    pub(crate) fn get_vars(&self) -> IndexSet<Leaf> {
+        self.atoms
+            .iter()
+            .flat_map(|atom| atom.vars())
+            .collect::<IndexSet<_>>()
+    }
+}
+
+impl<Head, Leaf> AddAssign for Query<Head, Leaf> {
+    fn add_assign(&mut self, rhs: Self) {
+        self.atoms.extend(rhs.atoms);
+    }
+}
+
+impl std::fmt::Display for Query<Symbol, Symbol> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        for atom in &self.atoms {
+            writeln!(f, "{atom}")?;
+        }
+        Ok(())
+    }
+}
+
+impl std::fmt::Display for Query<ResolvedCall, Symbol> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        for atom in self.funcs() {
+            writeln!(f, "{atom}")?;
+        }
+        let filters: Vec<_> = self.filters().collect();
+        if !filters.is_empty() {
+            writeln!(f, "where ")?;
+            for filter in &filters {
+                writeln!(
+                    f,
+                    "({} {})",
+                    filter.head.primitive.name(),
+                    ListDisplay(&filter.args, " ")
+                )?;
+            }
+        }
+        Ok(())
+    }
+}
+
+impl<Leaf: Clone> Query<ResolvedCall, Leaf> {
+    pub fn filters(&self) -> impl Iterator<Item = GenericAtom<SpecializedPrimitive, Leaf>> + '_ {
+        self.atoms.iter().filter_map(|atom| match &atom.head {
+            ResolvedCall::Func(_) => None,
+            ResolvedCall::Primitive(head) => Some(GenericAtom {
+                span: atom.span.clone(),
+                head: head.clone(),
+                args: atom.args.clone(),
+            }),
+        })
+    }
+
+    pub fn funcs(&self) -> impl Iterator<Item = GenericAtom<Symbol, Leaf>> + '_ {
+        self.atoms.iter().filter_map(|atom| match &atom.head {
+            ResolvedCall::Func(head) => Some(GenericAtom {
+                span: atom.span.clone(),
+                head: head.name,
+                args: atom.args.clone(),
+            }),
+            ResolvedCall::Primitive(_) => None,
+        })
+    }
+}
+
+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+pub enum GenericCoreAction<Head, Leaf> {
+    Let(Span, Leaf, Head, Vec<GenericAtomTerm<Leaf>>),
+    LetAtomTerm(Span, Leaf, GenericAtomTerm<Leaf>),
+    Extract(Span, GenericAtomTerm<Leaf>, GenericAtomTerm<Leaf>),
+    Set(
+        Span,
+        Head,
+        Vec<GenericAtomTerm<Leaf>>,
+        GenericAtomTerm<Leaf>,
+    ),
+    Change(Span, Change, Head, Vec<GenericAtomTerm<Leaf>>),
+    Union(Span, GenericAtomTerm<Leaf>, GenericAtomTerm<Leaf>),
+    Panic(Span, String),
+}
+
+pub type CoreAction = GenericCoreAction<Symbol, Symbol>;
+
+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+pub struct GenericCoreActions<Head, Leaf>(pub(crate) Vec<GenericCoreAction<Head, Leaf>>);
+pub(crate) type ResolvedCoreActions = GenericCoreActions<ResolvedCall, ResolvedVar>;
+
+impl<Head, Leaf> Default for GenericCoreActions<Head, Leaf> {
+    fn default() -> Self {
+        Self(vec![])
+    }
+}
+
+impl<Head, Leaf> GenericCoreActions<Head, Leaf>
+where
+    Leaf: Clone,
+{
+    pub(crate) fn subst(&mut self, subst: &HashMap<Leaf, GenericAtomTerm<Leaf>>) {
+        let actions = subst.iter().map(|(symbol, atom_term)| {
+            GenericCoreAction::LetAtomTerm(
+                atom_term.span().clone(),
+                symbol.clone(),
+                atom_term.clone(),
+            )
+        });
+        let existing_actions = std::mem::take(&mut self.0);
+        self.0 = actions.chain(existing_actions).collect();
+    }
+
+    fn new(actions: Vec<GenericCoreAction<Head, Leaf>>) -> GenericCoreActions<Head, Leaf> {
+        Self(actions)
+    }
+}
+
+#[allow(clippy::type_complexity)]
+impl<Head, Leaf> GenericActions<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    pub(crate) fn to_core_actions<FG: FreshGen<Head, Leaf>>(
+        &self,
+        typeinfo: &TypeInfo,
+        binding: &mut IndexSet<Leaf>,
+        fresh_gen: &mut FG,
+    ) -> Result<(GenericCoreActions<Head, Leaf>, MappedActions<Head, Leaf>), TypeError>
+    where
+        Leaf: SymbolLike,
+    {
+        let mut norm_actions = vec![];
+        let mut mapped_actions: MappedActions<Head, Leaf> = GenericActions(vec![]);
+
+        // During the lowering, there are two important guaratees:
+        //   Every used variable should be bound.
+        //   Every introduced variable should be unbound before.
+        for action in self.0.iter() {
+            match action {
+                GenericAction::Let(span, var, expr) => {
+                    if binding.contains(var) {
+                        return Err(TypeError::AlreadyDefined(var.to_symbol(), span.clone()));
+                    }
+                    let (actions, mapped_expr) =
+                        expr.to_core_actions(typeinfo, binding, fresh_gen)?;
+                    norm_actions.extend(actions.0);
+                    norm_actions.push(GenericCoreAction::LetAtomTerm(
+                        span.clone(),
+                        var.clone(),
+                        mapped_expr.get_corresponding_var_or_lit(typeinfo),
+                    ));
+                    mapped_actions.0.push(GenericAction::Let(
+                        span.clone(),
+                        var.clone(),
+                        mapped_expr,
+                    ));
+                    binding.insert(var.clone());
+                }
+                GenericAction::Set(span, head, args, expr) => {
+                    let mut mapped_args = vec![];
+                    for arg in args {
+                        let (actions, mapped_arg) =
+                            arg.to_core_actions(typeinfo, binding, fresh_gen)?;
+                        norm_actions.extend(actions.0);
+                        mapped_args.push(mapped_arg);
+                    }
+                    let (actions, mapped_expr) =
+                        expr.to_core_actions(typeinfo, binding, fresh_gen)?;
+                    norm_actions.extend(actions.0);
+                    norm_actions.push(GenericCoreAction::Set(
+                        span.clone(),
+                        head.clone(),
+                        mapped_args
+                            .iter()
+                            .map(|e| e.get_corresponding_var_or_lit(typeinfo))
+                            .collect(),
+                        mapped_expr.get_corresponding_var_or_lit(typeinfo),
+                    ));
+                    let v = fresh_gen.fresh(head);
+                    mapped_actions.0.push(GenericAction::Set(
+                        span.clone(),
+                        CorrespondingVar::new(head.clone(), v),
+                        mapped_args,
+                        mapped_expr,
+                    ));
+                }
+                GenericAction::Change(span, change, head, args) => {
+                    let mut mapped_args = vec![];
+                    for arg in args {
+                        let (actions, mapped_arg) =
+                            arg.to_core_actions(typeinfo, binding, fresh_gen)?;
+                        norm_actions.extend(actions.0);
+                        mapped_args.push(mapped_arg);
+                    }
+                    norm_actions.push(GenericCoreAction::Change(
+                        span.clone(),
+                        *change,
+                        head.clone(),
+                        mapped_args
+                            .iter()
+                            .map(|e| e.get_corresponding_var_or_lit(typeinfo))
+                            .collect(),
+                    ));
+                    let v = fresh_gen.fresh(head);
+                    mapped_actions.0.push(GenericAction::Change(
+                        span.clone(),
+                        *change,
+                        CorrespondingVar::new(head.clone(), v),
+                        mapped_args,
+                    ));
+                }
+                GenericAction::Union(span, e1, e2) => {
+                    let (actions1, mapped_e1) = e1.to_core_actions(typeinfo, binding, fresh_gen)?;
+                    norm_actions.extend(actions1.0);
+                    let (actions2, mapped_e2) = e2.to_core_actions(typeinfo, binding, fresh_gen)?;
+                    norm_actions.extend(actions2.0);
+                    norm_actions.push(GenericCoreAction::Union(
+                        span.clone(),
+                        mapped_e1.get_corresponding_var_or_lit(typeinfo),
+                        mapped_e2.get_corresponding_var_or_lit(typeinfo),
+                    ));
+                    mapped_actions
+                        .0
+                        .push(GenericAction::Union(span.clone(), mapped_e1, mapped_e2));
+                }
+                GenericAction::Extract(span, e, n) => {
+                    let (actions, mapped_e) = e.to_core_actions(typeinfo, binding, fresh_gen)?;
+                    norm_actions.extend(actions.0);
+                    let (actions, mapped_n) = n.to_core_actions(typeinfo, binding, fresh_gen)?;
+                    norm_actions.extend(actions.0);
+                    norm_actions.push(GenericCoreAction::Extract(
+                        span.clone(),
+                        mapped_e.get_corresponding_var_or_lit(typeinfo),
+                        mapped_n.get_corresponding_var_or_lit(typeinfo),
+                    ));
+                    mapped_actions
+                        .0
+                        .push(GenericAction::Extract(span.clone(), mapped_e, mapped_n));
+                }
+                GenericAction::Panic(span, string) => {
+                    norm_actions.push(GenericCoreAction::Panic(span.clone(), string.clone()));
+                    mapped_actions
+                        .0
+                        .push(GenericAction::Panic(span.clone(), string.clone()));
+                }
+                GenericAction::Expr(span, expr) => {
+                    let (actions, mapped_expr) =
+                        expr.to_core_actions(typeinfo, binding, fresh_gen)?;
+                    norm_actions.extend(actions.0);
+                    mapped_actions
+                        .0
+                        .push(GenericAction::Expr(span.clone(), mapped_expr));
+                }
+            }
+        }
+        Ok((GenericCoreActions::new(norm_actions), mapped_actions))
+    }
+}
+
+impl<Head, Leaf> GenericExpr<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash,
+{
+    pub(crate) fn to_query(
+        &self,
+        typeinfo: &TypeInfo,
+        fresh_gen: &mut impl FreshGen<Head, Leaf>,
+    ) -> (
+        Vec<GenericAtom<HeadOrEq<Head>, Leaf>>,
+        MappedExpr<Head, Leaf>,
+    )
+    where
+        Leaf: SymbolLike,
+    {
+        match self {
+            GenericExpr::Lit(span, lit) => (vec![], GenericExpr::Lit(span.clone(), lit.clone())),
+            GenericExpr::Var(span, v) => (vec![], GenericExpr::Var(span.clone(), v.clone())),
+            GenericExpr::Call(span, f, children) => {
+                let fresh = fresh_gen.fresh(f);
+                let mut new_children = vec![];
+                let mut atoms = vec![];
+                let mut child_exprs = vec![];
+                for child in children {
+                    let (child_atoms, child_expr) = child.to_query(typeinfo, fresh_gen);
+                    let child_atomterm = child_expr.get_corresponding_var_or_lit(typeinfo);
+                    new_children.push(child_atomterm);
+                    atoms.extend(child_atoms);
+                    child_exprs.push(child_expr);
+                }
+                let args = {
+                    new_children.push(GenericAtomTerm::Var(span.clone(), fresh.clone()));
+                    new_children
+                };
+                atoms.push(GenericAtom {
+                    span: span.clone(),
+                    head: HeadOrEq::Symbol(f.clone()),
+                    args,
+                });
+                (
+                    atoms,
+                    GenericExpr::Call(
+                        span.clone(),
+                        CorrespondingVar::new(f.clone(), fresh),
+                        child_exprs,
+                    ),
+                )
+            }
+        }
+    }
+
+    pub(crate) fn to_core_actions<FG: FreshGen<Head, Leaf>>(
+        &self,
+        typeinfo: &TypeInfo,
+        binding: &mut IndexSet<Leaf>,
+        fresh_gen: &mut FG,
+    ) -> Result<(GenericCoreActions<Head, Leaf>, MappedExpr<Head, Leaf>), TypeError>
+    where
+        Leaf: Hash + Eq + SymbolLike,
+    {
+        match self {
+            GenericExpr::Lit(span, lit) => Ok((
+                GenericCoreActions::default(),
+                GenericExpr::Lit(span.clone(), lit.clone()),
+            )),
+            GenericExpr::Var(span, v) => {
+                let sym = v.to_symbol();
+                if binding.contains(v) || typeinfo.is_global(sym) {
+                    Ok((
+                        GenericCoreActions::default(),
+                        GenericExpr::Var(span.clone(), v.clone()),
+                    ))
+                } else {
+                    Err(TypeError::Unbound(sym, span.clone()))
+                }
+            }
+            GenericExpr::Call(span, f, args) => {
+                let mut norm_actions = vec![];
+                let mut norm_args = vec![];
+                let mut mapped_args = vec![];
+                for arg in args {
+                    let (actions, mapped_arg) =
+                        arg.to_core_actions(typeinfo, binding, fresh_gen)?;
+                    norm_actions.extend(actions.0);
+                    norm_args.push(mapped_arg.get_corresponding_var_or_lit(typeinfo));
+                    mapped_args.push(mapped_arg);
+                }
+
+                let var = fresh_gen.fresh(f);
+                binding.insert(var.clone());
+
+                norm_actions.push(GenericCoreAction::Let(
+                    span.clone(),
+                    var.clone(),
+                    f.clone(),
+                    norm_args,
+                ));
+                Ok((
+                    GenericCoreActions::new(norm_actions),
+                    GenericExpr::Call(
+                        span.clone(),
+                        CorrespondingVar::new(f.clone(), var),
+                        mapped_args,
+                    ),
+                ))
+            }
+        }
+    }
+}
+
+/// A [`GenericCoreRule`] represents a generalization of lowered form of a rule.
+/// Unlike other `Generic`-prefixed types, [`GenericCoreRule`] takes two `Head`
+/// parameters instead of one. This is because the `Head` parameter of `body` and
+/// `head` can be different. In particular, early in the compilation pipeline,
+/// `body` can contain `Eq` atoms, which denotes equality constraints, so the `Head`
+/// for `body` needs to be a `HeadOrEq<Head>`, while `head` does not have equality
+/// constraints.
+#[derive(Debug, Clone)]
+pub struct GenericCoreRule<HeadQ, HeadA, Leaf> {
+    pub span: Span,
+    pub body: Query<HeadQ, Leaf>,
+    pub head: GenericCoreActions<HeadA, Leaf>,
+}
+
+pub(crate) type CoreRule = GenericCoreRule<SymbolOrEq, Symbol, Symbol>;
+pub(crate) type ResolvedCoreRule = GenericCoreRule<ResolvedCall, ResolvedCall, ResolvedVar>;
+
+impl<Head1, Head2, Leaf> GenericCoreRule<Head1, Head2, Leaf>
+where
+    Head1: Clone,
+    Head2: Clone,
+    Leaf: Clone + Eq + Hash,
+{
+    pub fn subst(&mut self, subst: &HashMap<Leaf, GenericAtomTerm<Leaf>>) {
+        for atom in &mut self.body.atoms {
+            atom.subst(subst);
+        }
+        self.head.subst(subst);
+    }
+}
+
+impl<Head, Leaf> GenericCoreRule<HeadOrEq<Head>, Head, Leaf>
+where
+    Leaf: Eq + Clone + Hash + Debug,
+    Head: Clone,
+{
+    /// Transformed a UnresolvedCoreRule into a CanonicalizedCoreRule.
+    /// In particular, it removes equality checks between variables and
+    /// other arguments, and turns equality checks between non-variable arguments
+    /// into a primitive equality check `value-eq`.
+    pub(crate) fn canonicalize(
+        self,
+        // Users need to pass in a substitute for equality constraints.
+        value_eq: impl Fn(&GenericAtomTerm<Leaf>, &GenericAtomTerm<Leaf>) -> Head,
+    ) -> GenericCoreRule<Head, Head, Leaf> {
+        let mut result_rule = self;
+        loop {
+            let mut to_subst = None;
+            for atom in result_rule.body.atoms.iter() {
+                if atom.head.is_eq() && atom.args[0] != atom.args[1] {
+                    match &atom.args[..] {
+                        [GenericAtomTerm::Var(_, x), y] | [y, GenericAtomTerm::Var(_, x)] => {
+                            to_subst = Some((x, y));
+                            break;
+                        }
+                        _ => (),
+                    }
+                }
+            }
+            if let Some((x, y)) = to_subst {
+                let subst = HashMap::from_iter([(x.clone(), y.clone())]);
+                result_rule.subst(&subst);
+            } else {
+                break;
+            }
+        }
+
+        let atoms = result_rule
+            .body
+            .atoms
+            .into_iter()
+            .filter_map(|atom| match atom.head {
+                HeadOrEq::Eq => {
+                    assert_eq!(atom.args.len(), 2);
+                    match (&atom.args[0], &atom.args[1]) {
+                        (GenericAtomTerm::Var(_, v1), GenericAtomTerm::Var(_, v2)) => {
+                            assert_eq!(v1, v2);
+                            None
+                        }
+                        (GenericAtomTerm::Var(..), _) | (_, GenericAtomTerm::Var(..)) => {
+                            panic!("equalities between variable and non-variable arguments should have been canonicalized")
+                        }
+                        (at1, at2) => {
+                            if at1 == at2 {
+                                None
+                            } else {
+                                Some(GenericAtom {
+                                    span: atom.span.clone(),
+                                    head: value_eq(&atom.args[0], &atom.args[1]),
+                                    args: vec![
+                                        atom.args[0].clone(),
+                                        atom.args[1].clone(),
+                                        GenericAtomTerm::Literal(atom.span.clone(), Literal::Unit),
+                                    ],
+                                })
+                            }
+                        },
+                    }
+                }
+                HeadOrEq::Symbol(symbol) => Some(GenericAtom {
+                    span: atom.span.clone(),
+                    head: symbol,
+                    args: atom.args,
+                }),
+            })
+            .collect();
+        GenericCoreRule {
+            span: result_rule.span,
+            body: Query { atoms },
+            head: result_rule.head,
+        }
+    }
+}
+
+impl<Head, Leaf> GenericRule<Head, Leaf>
+where
+    Head: Clone + Display,
+    Leaf: Clone + PartialEq + Eq + Display + Hash + Debug,
+{
+    pub(crate) fn to_core_rule(
+        &self,
+        typeinfo: &TypeInfo,
+        fresh_gen: &mut impl FreshGen<Head, Leaf>,
+    ) -> Result<GenericCoreRule<HeadOrEq<Head>, Head, Leaf>, TypeError>
+    where
+        Leaf: SymbolLike,
+    {
+        let GenericRule {
+            span: _,
+            head,
+            body,
+        } = self;
+
+        let (body, _correspondence) = Facts(body.clone()).to_query(typeinfo, fresh_gen);
+        let mut binding = body.get_vars();
+        let (head, _correspondence) = head.to_core_actions(typeinfo, &mut binding, fresh_gen)?;
+        Ok(GenericCoreRule {
+            span: self.span.clone(),
+            body,
+            head,
+        })
+    }
+
+    fn to_canonicalized_core_rule_impl(
+        &self,
+        typeinfo: &TypeInfo,
+        fresh_gen: &mut impl FreshGen<Head, Leaf>,
+        value_eq: impl Fn(&GenericAtomTerm<Leaf>, &GenericAtomTerm<Leaf>) -> Head,
+    ) -> Result<GenericCoreRule<Head, Head, Leaf>, TypeError>
+    where
+        Leaf: SymbolLike,
+    {
+        let rule = self.to_core_rule(typeinfo, fresh_gen)?;
+        Ok(rule.canonicalize(value_eq))
+    }
+}
+
+impl ResolvedRule {
+    pub(crate) fn to_canonicalized_core_rule(
+        &self,
+        typeinfo: &TypeInfo,
+        fresh_gen: &mut SymbolGen,
+    ) -> Result<ResolvedCoreRule, TypeError> {
+        let value_eq = &typeinfo.primitives.get(&Symbol::from("value-eq")).unwrap()[0];
+        self.to_canonicalized_core_rule_impl(typeinfo, fresh_gen, |at1, at2| {
+            ResolvedCall::Primitive(SpecializedPrimitive {
+                primitive: value_eq.clone(),
+                input: vec![at1.output(), at2.output()],
+                output: Arc::new(UnitSort),
+            })
+        })
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/extract.rs.html b/docs/src/egglog/extract.rs.html new file mode 100644 index 00000000..90be6b00 --- /dev/null +++ b/docs/src/egglog/extract.rs.html @@ -0,0 +1,425 @@ +extract.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+
use crate::ast::Symbol;
+use crate::termdag::{Term, TermDag};
+use crate::util::HashMap;
+use crate::{ArcSort, EGraph, Function, HEntry, Id, Value};
+
+pub type Cost = usize;
+
+#[derive(Debug)]
+pub(crate) struct Node<'a> {
+    sym: Symbol,
+    func: &'a Function,
+    inputs: &'a [Value],
+}
+
+pub struct Extractor<'a> {
+    pub costs: HashMap<Id, (Cost, Term)>,
+    ctors: Vec<Symbol>,
+    egraph: &'a EGraph,
+}
+
+impl EGraph {
+    /// This example uses [`EGraph::extract`] to extract a term. The example is
+    /// trivial, as there is only a single variant of the expression in the
+    /// egraph.
+    /// ```
+    /// use egglog::{EGraph, TermDag};
+    /// let mut egraph = EGraph::default();
+    /// egraph
+    ///     .parse_and_run_program(
+    ///         None,
+    ///         "(datatype Op (Add i64 i64))
+    ///          (let expr (Add 1 1))",
+    ///     )
+    ///     .unwrap();
+    /// let mut termdag = TermDag::default();
+    /// let (sort, value) = egraph
+    ///     .eval_expr(&egglog::ast::Expr::var_no_span("expr"))
+    ///     .unwrap();
+    /// let (_, extracted) = egraph.extract(value, &mut termdag, &sort);
+    /// assert_eq!(termdag.to_string(&extracted), "(Add 1 1)");
+    /// ```
+    pub fn extract(&self, value: Value, termdag: &mut TermDag, arcsort: &ArcSort) -> (Cost, Term) {
+        let extractor = Extractor::new(self, termdag);
+        extractor
+            .find_best(value, termdag, arcsort)
+            .unwrap_or_else(|| {
+                log::error!("No cost for {:?}", value);
+                for func in self.functions.values() {
+                    for (inputs, output) in func.nodes.iter(false) {
+                        if output.value == value {
+                            log::error!("Found unextractable function: {:?}", func.decl.name);
+                            log::error!("Inputs: {:?}", inputs);
+
+                            assert_eq!(inputs.len(), func.schema.input.len());
+                            log::error!(
+                                "{:?}",
+                                inputs
+                                    .iter()
+                                    .zip(&func.schema.input)
+                                    .map(|(input, sort)| extractor
+                                        .costs
+                                        .get(&extractor.egraph.find(sort, *input).bits))
+                                    .collect::<Vec<_>>()
+                            );
+                        }
+                    }
+                }
+
+                panic!("No cost for {:?}", value)
+            })
+    }
+
+    pub fn extract_variants(
+        &mut self,
+        sort: &ArcSort,
+        value: Value,
+        limit: usize,
+        termdag: &mut TermDag,
+    ) -> Vec<Term> {
+        let output_sort = sort.name();
+        let output_value = self.find(sort, value);
+        let ext = &Extractor::new(self, termdag);
+        ext.ctors
+            .iter()
+            .flat_map(|&sym| {
+                let func = &self.functions[&sym];
+                if !func.schema.output.is_eq_sort() {
+                    return vec![];
+                }
+                assert!(func.schema.output.is_eq_sort());
+
+                func.nodes
+                    .iter(false)
+                    .filter(|&(_, output)| {
+                        func.schema.output.name() == output_sort && output.value == output_value
+                    })
+                    .map(|(inputs, _output)| {
+                        let node = Node { sym, func, inputs };
+                        ext.expr_from_node(&node, termdag).expect(
+                            "extract_variants should be called after extractor initialization",
+                        )
+                    })
+                    .collect()
+            })
+            .take(limit)
+            .collect()
+    }
+}
+
+impl<'a> Extractor<'a> {
+    pub fn new(egraph: &'a EGraph, termdag: &mut TermDag) -> Self {
+        let mut extractor = Extractor {
+            costs: HashMap::default(),
+            egraph,
+            ctors: vec![],
+        };
+
+        // only consider "extractable" functions
+        extractor.ctors.extend(
+            egraph
+                .functions
+                .keys()
+                .filter(|func| !egraph.functions.get(*func).unwrap().decl.unextractable)
+                .cloned(),
+        );
+
+        log::debug!("Extracting from ctors: {:?}", extractor.ctors);
+        extractor.find_costs(termdag);
+        extractor
+    }
+
+    fn expr_from_node(&self, node: &Node, termdag: &mut TermDag) -> Option<Term> {
+        let mut children = vec![];
+
+        let values = node.inputs;
+        let arcsorts = &node.func.schema.input;
+        assert_eq!(values.len(), arcsorts.len());
+
+        for (value, arcsort) in values.iter().zip(arcsorts) {
+            children.push(self.find_best(*value, termdag, arcsort)?.1)
+        }
+
+        Some(termdag.app(node.sym, children))
+    }
+
+    pub fn find_best(
+        &self,
+        value: Value,
+        termdag: &mut TermDag,
+        sort: &ArcSort,
+    ) -> Option<(Cost, Term)> {
+        if sort.is_eq_sort() {
+            let id = self.egraph.find(sort, value).bits;
+            let (cost, node) = self.costs.get(&id)?.clone();
+            Some((cost, node))
+        } else {
+            let (cost, node) = sort.extract_expr(self.egraph, value, self, termdag)?;
+            Some((cost, termdag.expr_to_term(&node)))
+        }
+    }
+
+    fn node_total_cost(
+        &mut self,
+        function: &Function,
+        children: &[Value],
+        termdag: &mut TermDag,
+    ) -> Option<(Vec<Term>, Cost)> {
+        let mut cost = function.decl.cost.unwrap_or(1);
+        let types = &function.schema.input;
+        let mut terms: Vec<Term> = vec![];
+        for (ty, value) in types.iter().zip(children) {
+            let (term_cost, term) = self.find_best(*value, termdag, ty)?;
+            terms.push(term.clone());
+            cost = cost.saturating_add(term_cost);
+        }
+        Some((terms, cost))
+    }
+
+    fn find_costs(&mut self, termdag: &mut TermDag) {
+        let mut did_something = true;
+        while did_something {
+            did_something = false;
+
+            for sym in self.ctors.clone() {
+                let func = &self.egraph.functions[&sym];
+                if func.schema.output.is_eq_sort() {
+                    for (inputs, output) in func.nodes.iter(false) {
+                        if let Some((term_inputs, new_cost)) =
+                            self.node_total_cost(func, inputs, termdag)
+                        {
+                            let make_new_pair = || (new_cost, termdag.app(sym, term_inputs));
+
+                            let id = self.egraph.find(&func.schema.output, output.value).bits;
+                            match self.costs.entry(id) {
+                                HEntry::Vacant(e) => {
+                                    did_something = true;
+                                    e.insert(make_new_pair());
+                                }
+                                HEntry::Occupied(mut e) => {
+                                    if new_cost < e.get().0 {
+                                        did_something = true;
+                                        e.insert(make_new_pair());
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/function/binary_search.rs.html b/docs/src/egglog/function/binary_search.rs.html new file mode 100644 index 00000000..5f2304a8 --- /dev/null +++ b/docs/src/egglog/function/binary_search.rs.html @@ -0,0 +1,179 @@ +binary_search.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+
use std::cmp::Ordering;
+
+use super::table::Table;
+
+/// Binary search a [`Table`] for the smallest index with a timestamp greater
+/// than or equal to `target`.
+pub(crate) fn binary_search_table_by_key(data: &Table, target: u32) -> Option<usize> {
+    if data.is_empty() {
+        return None;
+    }
+    if data.max_ts() < target {
+        return None;
+    }
+    if data.min_ts().unwrap() > target {
+        return Some(0);
+    }
+    // adapted from std::slice::binary_search_by
+    let mut size = data.num_offsets();
+    let mut left = 0;
+    let mut right = size;
+    while left < right {
+        let mut mid = left + size / 2;
+        let cmp = data.get_timestamp(mid).unwrap().cmp(&target);
+
+        // The std implementation claims that if/else generates better code than match.
+        if cmp == Ordering::Less {
+            left = mid + 1;
+        } else if cmp == Ordering::Greater {
+            right = mid;
+        } else {
+            // We need to march back to the start of the matching elements. We
+            // could have jumped into the middle of a run.
+            //
+            // TODO: this makes the algorithm O(n); we can use a variant of
+            // gallop to get it back to log(n) if needed. See
+            // https://github.com/frankmcsherry/blog/blob/master/posts/2018-05-19.md
+            while mid > 0 {
+                let next_mid = mid - 1;
+                if data.get_timestamp(next_mid).unwrap() != target {
+                    break;
+                }
+                mid = next_mid;
+            }
+            return Some(mid);
+        }
+        size = right - left;
+    }
+    Some(left)
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::Value;
+
+    fn make_value(bits: u32) -> Value {
+        Value {
+            #[cfg(debug_assertions)]
+            tag: "testing".into(),
+            bits: bits as u64,
+        }
+    }
+
+    fn insert_to_map(table: &mut Table, i: u32, ts: u32) {
+        let v = make_value(i);
+        table.insert(&[v], v, ts);
+    }
+
+    #[test]
+    fn binary_search() {
+        let mut map = Table::default();
+        assert_eq!(binary_search_table_by_key(&map, 0), None);
+        insert_to_map(&mut map, 1, 1);
+        assert_eq!(binary_search_table_by_key(&map, 0), Some(0));
+        map.clear();
+        for i in 0..128 {
+            // have a run of 4 24s and then skip to 26
+            let v = if i == 50 || i == 51 { 24 } else { i / 2 };
+            insert_to_map(&mut map, i, v);
+        }
+
+        assert_eq!(binary_search_table_by_key(&map, 3), Some(6));
+        assert_eq!(binary_search_table_by_key(&map, 0), Some(0));
+        assert_eq!(binary_search_table_by_key(&map, 63), Some(126));
+        assert_eq!(binary_search_table_by_key(&map, 200), None);
+        assert_eq!(binary_search_table_by_key(&map, 24), Some(48));
+        assert_eq!(binary_search_table_by_key(&map, 25), Some(52));
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/function/index.rs.html b/docs/src/egglog/function/index.rs.html new file mode 100644 index 00000000..e050d04b --- /dev/null +++ b/docs/src/egglog/function/index.rs.html @@ -0,0 +1,205 @@ +index.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+
//! Column-level indexes on values from a common sort.
+use smallvec::SmallVec;
+
+use crate::{unionfind::UnionFind, util::HashMap, Symbol, Value};
+
+pub(crate) type Offset = u32;
+
+#[derive(Clone, Debug)]
+pub(crate) struct ColumnIndex {
+    sort: Symbol,
+    ids: HashMap<u64, SmallVec<[Offset; 8]>>,
+}
+
+impl ColumnIndex {
+    pub(crate) fn new(sort: Symbol) -> ColumnIndex {
+        ColumnIndex {
+            sort,
+            ids: Default::default(),
+        }
+    }
+
+    pub(crate) fn sort(&self) -> Symbol {
+        self.sort
+    }
+
+    pub(crate) fn add(&mut self, v: Value, i: usize) {
+        #[cfg(debug_assertions)]
+        assert_eq!(v.tag, self.sort);
+
+        self.ids.entry(v.bits).or_default().push(i as Offset);
+    }
+
+    pub(crate) fn clear(&mut self) {
+        self.ids.clear()
+    }
+
+    pub(crate) fn len(&self) -> usize {
+        self.ids.len()
+    }
+
+    pub(crate) fn get(&self, v: &Value) -> Option<&[Offset]> {
+        self.get_indexes_for_bits(v.bits)
+    }
+
+    fn get_indexes_for_bits(&self, bits: u64) -> Option<&[Offset]> {
+        self.ids.get(&bits).map(|x| x.as_slice())
+    }
+
+    pub(crate) fn iter(&self) -> impl Iterator<Item = (Value, &[Offset])> + '_ {
+        self.ids.iter().map(|(bits, v)| {
+            (
+                Value {
+                    #[cfg(debug_assertions)]
+                    tag: self.sort,
+                    bits: *bits,
+                },
+                v.as_slice(),
+            )
+        })
+    }
+
+    pub(crate) fn to_canonicalize<'a>(
+        &'a self,
+        uf: &'a UnionFind,
+    ) -> impl Iterator<Item = usize> + '_ {
+        uf.dirty_ids(self.sort).flat_map(|x| {
+            self.get_indexes_for_bits(x)
+                .unwrap_or(&[])
+                .iter()
+                .copied()
+                .map(|x| x as usize)
+        })
+    }
+}
+#[derive(Clone, Debug)]
+pub(crate) struct CompositeColumnIndex(SmallVec<[ColumnIndex; 2]>);
+
+impl CompositeColumnIndex {
+    pub(crate) fn new() -> CompositeColumnIndex {
+        CompositeColumnIndex(SmallVec::new())
+    }
+
+    pub(crate) fn add(&mut self, s: Symbol, v: Value, i: usize) {
+        if let Some(index) = self.0.iter().position(|index| index.sort() == s) {
+            (self.0)[index].add(v, i);
+        } else {
+            let mut index = ColumnIndex::new(s);
+            index.add(v, i);
+            self.0.push(index);
+        }
+    }
+
+    pub(crate) fn clear(&mut self) {
+        for index in self.0.iter_mut() {
+            index.clear();
+        }
+    }
+
+    pub(crate) fn iter(&self) -> impl Iterator<Item = &ColumnIndex> {
+        self.0.iter()
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/function/mod.rs.html b/docs/src/egglog/function/mod.rs.html new file mode 100644 index 00000000..84ea4baa --- /dev/null +++ b/docs/src/egglog/function/mod.rs.html @@ -0,0 +1,989 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+
use std::mem;
+
+use crate::*;
+use index::*;
+use smallvec::SmallVec;
+
+mod binary_search;
+pub mod index;
+pub(crate) mod table;
+
+pub type ValueVec = SmallVec<[Value; 3]>;
+
+#[derive(Clone)]
+pub struct Function {
+    pub(crate) decl: ResolvedFunctionDecl,
+    pub schema: ResolvedSchema,
+    pub merge: MergeAction,
+    pub(crate) nodes: table::Table,
+    sorts: HashSet<Symbol>,
+    pub(crate) indexes: Vec<Rc<ColumnIndex>>,
+    pub(crate) rebuild_indexes: Vec<Option<CompositeColumnIndex>>,
+    index_updated_through: usize,
+    updates: usize,
+    scratch: IndexSet<usize>,
+}
+
+#[derive(Clone)]
+pub struct MergeAction {
+    pub on_merge: Option<Rc<Program>>,
+    pub merge_vals: MergeFn,
+}
+
+#[derive(Clone)]
+pub enum MergeFn {
+    AssertEq,
+    Union,
+    // the rc is make sure it's cheaply clonable, since calling the merge fn
+    // requires a clone
+    Expr(Rc<Program>),
+}
+
+/// All information we know determined by the input.
+#[derive(Debug, Clone)]
+pub struct TupleOutput {
+    pub value: Value,
+    pub timestamp: u32,
+    pub subsumed: bool,
+}
+
+#[derive(Clone, Debug)]
+pub struct ResolvedSchema {
+    pub input: Vec<ArcSort>,
+    pub output: ArcSort,
+}
+
+impl ResolvedSchema {
+    pub fn get_by_pos(&self, index: usize) -> Option<&ArcSort> {
+        if self.input.len() == index {
+            Some(&self.output)
+        } else {
+            self.input.get(index)
+        }
+    }
+}
+
+impl Debug for Function {
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        f.debug_struct("Function")
+            .field("decl", &self.decl)
+            .field("schema", &self.schema)
+            .field("nodes", &self.nodes)
+            .field("indexes", &self.indexes)
+            .field("rebuild_indexes", &self.rebuild_indexes)
+            .field("index_updated_through", &self.index_updated_through)
+            .field("updates", &self.updates)
+            .field("scratch", &self.scratch)
+            .finish()
+    }
+}
+
+/// A non-Union merge discovered during rebuilding that has to be applied before
+/// resuming execution.
+pub(crate) type DeferredMerge = (ValueVec, Value, Value);
+
+impl Function {
+    pub(crate) fn new(egraph: &mut EGraph, decl: &ResolvedFunctionDecl) -> Result<Self, Error> {
+        let mut input = Vec::with_capacity(decl.schema.input.len());
+        for s in &decl.schema.input {
+            input.push(match egraph.type_info.sorts.get(s) {
+                Some(sort) => sort.clone(),
+                None => {
+                    return Err(Error::TypeError(TypeError::UndefinedSort(
+                        *s,
+                        decl.span.clone(),
+                    )))
+                }
+            })
+        }
+
+        let output = match egraph.type_info.sorts.get(&decl.schema.output) {
+            Some(sort) => sort.clone(),
+            None => {
+                return Err(Error::TypeError(TypeError::UndefinedSort(
+                    decl.schema.output,
+                    decl.span.clone(),
+                )))
+            }
+        };
+
+        let binding = IndexSet::from_iter([
+            ResolvedVar {
+                name: Symbol::from("old"),
+                sort: output.clone(),
+                is_global_ref: false,
+            },
+            ResolvedVar {
+                name: Symbol::from("new"),
+                sort: output.clone(),
+                is_global_ref: false,
+            },
+        ]);
+
+        // Invariant: the last element in the stack is the return value.
+        let merge_vals = if let Some(merge_expr) = &decl.merge {
+            let (actions, mapped_expr) = merge_expr.to_core_actions(
+                &egraph.type_info,
+                &mut binding.clone(),
+                &mut egraph.symbol_gen,
+            )?;
+            let target = mapped_expr.get_corresponding_var_or_lit(&egraph.type_info);
+            let program = egraph
+                .compile_expr(&binding, &actions, &target)
+                .map_err(Error::TypeErrors)?;
+            MergeFn::Expr(Rc::new(program))
+        } else if output.is_eq_sort() {
+            MergeFn::Union
+        } else {
+            MergeFn::AssertEq
+        };
+
+        let on_merge = if decl.merge_action.is_empty() {
+            None
+        } else {
+            let (merge_action, _) = decl.merge_action.to_core_actions(
+                &egraph.type_info,
+                &mut binding.clone(),
+                &mut egraph.symbol_gen,
+            )?;
+            let program = egraph
+                .compile_actions(&binding, &merge_action)
+                .map_err(Error::TypeErrors)?;
+            Some(Rc::new(program))
+        };
+
+        let indexes = Vec::from_iter(
+            input
+                .iter()
+                .chain(once(&output))
+                .map(|x| Rc::new(ColumnIndex::new(x.name()))),
+        );
+
+        let rebuild_indexes = Vec::from_iter(input.iter().chain(once(&output)).map(|x| {
+            if x.is_eq_container_sort() {
+                Some(CompositeColumnIndex::new())
+            } else {
+                None
+            }
+        }));
+
+        let sorts: HashSet<Symbol> = input
+            .iter()
+            .map(|x| x.name())
+            .chain(once(output.name()))
+            .collect();
+
+        Ok(Function {
+            decl: decl.clone(),
+            schema: ResolvedSchema { input, output },
+            nodes: Default::default(),
+            scratch: Default::default(),
+            sorts,
+            // TODO: build indexes for primitive sorts lazily
+            indexes,
+            rebuild_indexes,
+            index_updated_through: 0,
+            updates: 0,
+            merge: MergeAction {
+                on_merge,
+                merge_vals,
+            },
+        })
+    }
+
+    pub fn get(&self, inputs: &[Value]) -> Option<Value> {
+        self.nodes.get(inputs).map(|output| output.value)
+    }
+
+    pub fn insert(&mut self, inputs: &[Value], value: Value, timestamp: u32) -> Option<Value> {
+        self.insert_internal(inputs, value, timestamp, true)
+    }
+    pub fn clear(&mut self) {
+        self.nodes.clear();
+        self.indexes
+            .iter_mut()
+            .for_each(|x| Rc::make_mut(x).clear());
+        self.rebuild_indexes.iter_mut().for_each(|x| {
+            if let Some(x) = x {
+                x.clear()
+            }
+        });
+        self.index_updated_through = 0;
+    }
+    pub fn insert_internal(
+        &mut self,
+        inputs: &[Value],
+        value: Value,
+        timestamp: u32,
+        // Clean out all stale entries if they account for a sufficiently large
+        // portion of the table after this entry is inserted.
+        maybe_rehash: bool,
+    ) -> Option<Value> {
+        #[cfg(debug_assertions)]
+        for (v, sort) in inputs
+            .iter()
+            .zip(self.schema.input.iter())
+            .chain(once((&value, &self.schema.output)))
+        {
+            assert_eq!(sort.name(), v.tag);
+        }
+
+        let res = self.nodes.insert(inputs, value, timestamp);
+        if maybe_rehash {
+            self.maybe_rehash();
+        }
+        res
+    }
+
+    /// Mark the given inputs as subsumed.
+    pub fn subsume(&mut self, inputs: &[Value]) {
+        self.nodes.get_mut(inputs).unwrap().subsumed = true;
+    }
+
+    /// Return a column index that contains (a superset of) the offsets for the
+    /// given column. This method can return nothing if the indexes available
+    /// contain too many irrelevant offsets.
+    pub(crate) fn column_index(
+        &self,
+        col: usize,
+        timestamps: &Range<u32>,
+    ) -> Option<Rc<ColumnIndex>> {
+        let range = self.nodes.transform_range(timestamps);
+        if range.end > self.index_updated_through {
+            return None;
+        }
+        let size = range.end.saturating_sub(range.start);
+        // If this represents >12.5% overhead, don't use the index
+        if (self.nodes.num_offsets() - size) > (size / 8) {
+            return None;
+        }
+        let target = &self.indexes[col];
+        Some(target.clone())
+    }
+
+    pub(crate) fn remove(&mut self, ks: &[Value], ts: u32) -> bool {
+        let res = self.nodes.remove(ks, ts);
+        self.maybe_rehash();
+        res
+    }
+
+    pub(crate) fn clear_updates(&mut self) -> usize {
+        mem::take(&mut self.updates)
+    }
+
+    fn build_indexes(&mut self, offsets: Range<usize>) {
+        for (col, (index, rebuild_index)) in self
+            .indexes
+            .iter_mut()
+            .zip(self.rebuild_indexes.iter_mut())
+            .enumerate()
+        {
+            let as_mut = Rc::make_mut(index);
+            if col == self.schema.input.len() {
+                for (slot, _, out) in self.nodes.iter_range(offsets.clone(), true) {
+                    as_mut.add(out.value, slot)
+                }
+            } else {
+                for (slot, inp, _) in self.nodes.iter_range(offsets.clone(), true) {
+                    as_mut.add(inp[col], slot)
+                }
+            }
+
+            // rebuild_index
+            if let Some(rebuild_index) = rebuild_index {
+                if col == self.schema.input.len() {
+                    for (slot, _, out) in self.nodes.iter_range(offsets.clone(), true) {
+                        self.schema.output.foreach_tracked_values(
+                            &out.value,
+                            Box::new(|sort, value| rebuild_index.add(sort.name(), value, slot)),
+                        )
+                    }
+                } else {
+                    for (slot, inp, _) in self.nodes.iter_range(offsets.clone(), true) {
+                        self.schema.input[col].foreach_tracked_values(
+                            &inp[col],
+                            Box::new(|sort, value| rebuild_index.add(sort.name(), value, slot)),
+                        )
+                    }
+                }
+            }
+        }
+    }
+
+    fn update_indexes(&mut self, through: usize) {
+        self.build_indexes(self.index_updated_through..through);
+        self.index_updated_through = self.index_updated_through.max(through);
+    }
+
+    fn maybe_rehash(&mut self) {
+        if !self.nodes.too_stale() {
+            return;
+        }
+
+        for index in &mut self.indexes {
+            // Everything works if we don't have a unique copy of the indexes,
+            // but we ought to be able to avoid this copy.
+            Rc::make_mut(index).clear();
+        }
+        for rebuild_index in self.rebuild_indexes.iter_mut().flatten() {
+            rebuild_index.clear();
+        }
+        self.nodes.rehash();
+        self.index_updated_through = 0;
+        if self.nodes.is_empty() {
+            return;
+        }
+        self.update_indexes(self.nodes.num_offsets());
+    }
+
+    pub(crate) fn iter_timestamp_range(
+        &self,
+        timestamps: &Range<u32>,
+        include_subsumed: bool,
+    ) -> impl Iterator<Item = (usize, &[Value], &TupleOutput)> {
+        self.nodes
+            .iter_timestamp_range(timestamps, include_subsumed)
+    }
+
+    pub fn rebuild(
+        &mut self,
+        uf: &mut UnionFind,
+        timestamp: u32,
+    ) -> Result<(usize, Vec<DeferredMerge>), Error> {
+        // Make sure indexes are up to date.
+        self.update_indexes(self.nodes.num_offsets());
+        if self
+            .schema
+            .input
+            .iter()
+            .all(|s| !s.is_eq_sort() && !s.is_eq_container_sort())
+            && !self.schema.output.is_eq_sort()
+            && !self.schema.output.is_eq_container_sort()
+        {
+            return Ok((std::mem::take(&mut self.updates), Default::default()));
+        }
+        let mut deferred_merges = Vec::new();
+        let mut scratch = ValueVec::new();
+        let n_unions = uf.n_unions();
+
+        if uf.new_ids(|sort| self.sorts.contains(&sort)) > (self.nodes.num_offsets() / 2) {
+            // basic heuristic: if we displaced a large number of ids relative
+            // to the size of the table, then just rebuild everything.
+            for i in 0..self.nodes.num_offsets() {
+                self.rebuild_at(i, timestamp, uf, &mut scratch, &mut deferred_merges)?;
+            }
+        } else {
+            let mut to_canon = mem::take(&mut self.scratch);
+
+            to_canon.clear();
+
+            for (i, (ridx, idx)) in self
+                .rebuild_indexes
+                .iter()
+                .zip(self.indexes.iter())
+                .enumerate()
+            {
+                let sort = self.schema.get_by_pos(i).unwrap();
+                if !sort.is_eq_container_sort() && !sort.is_eq_sort() {
+                    // No need to canonicalize in this case
+                    continue;
+                }
+
+                // attempt to use the rebuilding index if it exists
+                if let Some(ridx) = ridx {
+                    debug_assert!(sort.is_eq_container_sort());
+                    to_canon.extend(ridx.iter().flat_map(|idx| idx.to_canonicalize(uf)))
+                } else {
+                    debug_assert!(sort.is_eq_sort());
+                    to_canon.extend(idx.to_canonicalize(uf))
+                }
+            }
+
+            for i in to_canon.iter().copied() {
+                self.rebuild_at(i, timestamp, uf, &mut scratch, &mut deferred_merges)?;
+            }
+            self.scratch = to_canon;
+        }
+        self.maybe_rehash();
+        Ok((
+            uf.n_unions() - n_unions + std::mem::take(&mut self.updates),
+            deferred_merges,
+        ))
+    }
+
+    fn rebuild_at(
+        &mut self,
+        i: usize,
+        timestamp: u32,
+        uf: &mut UnionFind,
+        scratch: &mut ValueVec,
+        deferred_merges: &mut Vec<(ValueVec, Value, Value)>,
+    ) -> Result<(), Error> {
+        let mut result: Result<(), Error> = Ok(());
+        let mut modified = false;
+        let (args, out) = if let Some(x) = self.nodes.get_index(i, true) {
+            x
+        } else {
+            // Entry is stale
+            return result;
+        };
+
+        let mut out_val = out.value;
+        scratch.clear();
+        scratch.extend(args.iter().copied());
+
+        for (val, ty) in scratch.iter_mut().zip(&self.schema.input) {
+            modified |= ty.canonicalize(val, uf);
+        }
+
+        modified |= self.schema.output.canonicalize(&mut out_val, uf);
+
+        if !modified {
+            return result;
+        }
+        let out_ty = &self.schema.output;
+        self.nodes
+            .insert_and_merge(scratch, timestamp, out.subsumed, |prev| {
+                if let Some(mut prev) = prev {
+                    out_ty.canonicalize(&mut prev, uf);
+                    let mut appended = false;
+                    if self.merge.on_merge.is_some() && prev != out_val {
+                        deferred_merges.push((scratch.clone(), prev, out_val));
+                        appended = true;
+                    }
+                    match &self.merge.merge_vals {
+                        MergeFn::Union => {
+                            debug_assert!(self.schema.output.is_eq_sort());
+                            uf.union_values(prev, out_val, self.schema.output.name())
+                        }
+                        MergeFn::AssertEq => {
+                            if prev != out_val {
+                                result = Err(Error::MergeError(self.decl.name, prev, out_val));
+                            }
+                            prev
+                        }
+                        MergeFn::Expr(_) => {
+                            if !appended && prev != out_val {
+                                deferred_merges.push((scratch.clone(), prev, out_val));
+                            }
+                            prev
+                        }
+                    }
+                } else {
+                    out_val
+                }
+            });
+        if let Some((inputs, _)) = self.nodes.get_index(i, true) {
+            if inputs != &scratch[..] {
+                scratch.clear();
+                scratch.extend_from_slice(inputs);
+                self.nodes.remove(scratch, timestamp);
+                scratch.clear();
+            }
+        }
+        result
+    }
+
+    pub(crate) fn get_size(&self, range: &Range<u32>) -> usize {
+        self.nodes.approximate_range_size(range)
+    }
+
+    pub fn is_extractable(&self) -> bool {
+        !self.decl.unextractable
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/function/table.rs.html b/docs/src/egglog/function/table.rs.html new file mode 100644 index 00000000..545b1a36 --- /dev/null +++ b/docs/src/egglog/function/table.rs.html @@ -0,0 +1,739 @@ +table.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+
//! A table type used to represent functions.
+//!
+//! Tables are essentially hash table mapping from vectors of values to values,
+//! but they make different trade-offs than standard HashMaps or IndexMaps:
+//!
+//! * Like indexmap, tables preserve insertion order and support lookups based on
+//! vector-like "offsets" in addition to table keys.
+//!
+//! * Unlike indexmap, these tables support constant-time removals that preserve
+//! insertion order. Removals merely mark entries as "stale."
+//!
+//! These features come at the cost of needing to periodically rehash the table.
+//! These rehashes must be done explicitly because they perturb the integer
+//! table offsets that are otherwise stable. We prefer explicit rehashes because
+//! column-level indexes use raw offsets into the table, and they need to be
+//! rebuilt when a rehash happens.
+//!
+//! The advantage of these features is that tables can be sorted by "timestamp,"
+//! making it efficient to iterate over subsets of a table matching a given
+//! timestamp range.
+//!
+//! Note on rehashing: We will eventually want to keep old/stale entries around
+//! to facilitate proofs/provenance. Early testing found that removing this in
+//! the "obvious" way (keeping 'vals' around, avoiding `mem::take()`s for stale
+//! entries, keeping stale entries out of `table` made some workloads very slow.
+//! It's likely that we will have to store these "on the side" or use some sort
+//! of persistent data-structure for the entire table.
+use std::{
+    fmt::{Debug, Formatter},
+    hash::{BuildHasher, Hash, Hasher},
+    mem,
+    ops::Range,
+};
+
+use hashbrown::HashTable;
+
+use super::binary_search::binary_search_table_by_key;
+use crate::{util::BuildHasher as BH, TupleOutput, Value, ValueVec};
+
+type Offset = usize;
+
+#[derive(Copy, Clone, PartialEq, Eq, Hash)]
+struct TableOffset {
+    // Hashes are stored inline in the table to avoid cache misses during
+    // probing, and to avoid `values` lookups entirely during insertions.
+    hash: u64,
+    off: Offset,
+}
+
+#[derive(Default, Clone)]
+pub(crate) struct Table {
+    max_ts: u32,
+    n_stale: usize,
+    table: HashTable<TableOffset>,
+    pub(crate) vals: Vec<(Input, TupleOutput)>,
+}
+
+/// Used for the HashTable probe sequence.
+macro_rules! search_for {
+    ($slf:expr, $hash:expr, $inp:expr) => {
+        |to| {
+            // Test that hashes match.
+            if to.hash != $hash {
+                return false;
+            }
+            // If the hash matches, the value should not be stale, and the data
+            // should match.
+            let inp = &$slf.vals[to.off as usize].0;
+            inp.live() && inp.data() == $inp
+        }
+    };
+}
+
+impl Debug for Table {
+    fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
+        f.debug_struct("Table")
+            .field("max_ts", &self.max_ts)
+            .field("n_stale", &self.n_stale)
+            .field("vals", &self.vals)
+            .finish()
+    }
+}
+
+impl Table {
+    /// Clear the contents of the table.
+    pub(crate) fn clear(&mut self) {
+        self.max_ts = 0;
+        self.n_stale = 0;
+        self.table.clear();
+        self.vals.clear();
+    }
+
+    /// Indicates whether or not the table should be rehashed.
+    pub(crate) fn too_stale(&self) -> bool {
+        self.n_stale > (self.vals.len() / 2)
+    }
+
+    /// Rehashes the table, invalidating any offsets stored into the table.
+    pub(crate) fn rehash(&mut self) {
+        let mut dst = 0usize;
+        self.table.clear();
+        self.vals.retain(|(inp, _)| {
+            if inp.live() {
+                let hash = hash_values(inp.data());
+                let to = TableOffset { hash, off: dst };
+                self.table
+                    .entry(hash, |to2| to2 == &to, |to2| to2.hash)
+                    .insert(to);
+                dst += 1;
+                true
+            } else {
+                false
+            }
+        });
+        self.n_stale = 0;
+    }
+
+    /// Get the entry in the table for the given values, if they are in the
+    /// table.
+    pub(crate) fn get(&self, inputs: &[Value]) -> Option<&TupleOutput> {
+        let hash = hash_values(inputs);
+        let &TableOffset { off, .. } = self.table.find(hash, search_for!(self, hash, inputs))?;
+        debug_assert!(self.vals[off].0.live());
+        Some(&self.vals[off].1)
+    }
+
+    pub(crate) fn get_mut(&mut self, inputs: &[Value]) -> Option<&mut TupleOutput> {
+        let hash: u64 = hash_values(inputs);
+        let &TableOffset { off, .. } = self.table.find(hash, search_for!(self, hash, inputs))?;
+        debug_assert!(self.vals[off].0.live());
+        Some(&mut self.vals[off].1)
+    }
+
+    /// Insert the given data into the table at the given timestamp. Return the
+    /// previous value, if there was one.
+    pub(crate) fn insert(&mut self, inputs: &[Value], out: Value, ts: u32) -> Option<Value> {
+        let mut res = None;
+        self.insert_and_merge(inputs, ts, false, |prev| {
+            res = prev;
+            out
+        });
+        res
+    }
+
+    /// Insert the given data into the table at the given timestamp. Thismethod
+    /// allows for efficient 'merges', conditional on the previous value mapped
+    /// to by the given index.
+    ///
+    /// * `on_merge(None)` should return the value mapping to the given slot.
+    /// * `on_merge(Some(x))` can return a "merged" value (e.g. the union union
+    ///   of `x` and `on_merge(None)`).
+    pub(crate) fn insert_and_merge(
+        &mut self,
+        inputs: &[Value],
+        ts: u32,
+        subsumed: bool,
+        on_merge: impl FnOnce(Option<Value>) -> Value,
+    ) {
+        assert!(ts >= self.max_ts);
+        self.max_ts = ts;
+        let hash = hash_values(inputs);
+        if let Some(TableOffset { off, .. }) =
+            self.table.find_mut(hash, search_for!(self, hash, inputs))
+        {
+            let (inp, prev) = &mut self.vals[*off];
+            let prev_subsumed = prev.subsumed;
+            let next = on_merge(Some(prev.value));
+            if next == prev.value && prev_subsumed == subsumed {
+                return;
+            }
+            inp.stale_at = ts;
+            self.n_stale += 1;
+            let k = mem::take(&mut inp.data);
+            let new_offset = self.vals.len();
+            self.vals.push((
+                Input::new(k),
+                TupleOutput {
+                    value: next,
+                    timestamp: ts,
+                    subsumed: subsumed || prev_subsumed,
+                },
+            ));
+            *off = new_offset;
+            return;
+        }
+        let new_offset = self.vals.len();
+        self.vals.push((
+            Input::new(inputs.into()),
+            TupleOutput {
+                value: on_merge(None),
+                timestamp: ts,
+                subsumed,
+            },
+        ));
+        let to = TableOffset {
+            hash,
+            off: new_offset,
+        };
+        self.table
+            .entry(hash, |to2| to2 == &to, |to2| to2.hash)
+            .insert(to);
+    }
+
+    /// One more than the maximum (potentially) valid offset into the table.
+    pub(crate) fn num_offsets(&self) -> usize {
+        self.vals.len()
+    }
+
+    /// One more than the actual valid offset (not including stale) into the table.
+    pub(crate) fn len(&self) -> usize {
+        self.vals.len() - self.n_stale
+    }
+
+    /// Whether the table is completely empty, including stale entries.
+    pub(crate) fn is_empty(&self) -> bool {
+        self.num_offsets() == 0
+    }
+
+    /// The minimum timestamp stored by the table, if there is one.
+    pub(crate) fn min_ts(&self) -> Option<u32> {
+        Some(self.vals.first()?.1.timestamp)
+    }
+
+    /// An upper bound for all timestamps stored in the table.
+    pub(crate) fn max_ts(&self) -> u32 {
+        self.max_ts
+    }
+
+    /// Get the timestamp for the entry at index `i`.
+    pub(crate) fn get_timestamp(&self, i: usize) -> Option<u32> {
+        Some(self.vals.get(i)?.1.timestamp)
+    }
+
+    /// Remove the given mapping from the table, returns whether an entry was
+    /// removed.
+    pub(crate) fn remove(&mut self, inp: &[Value], ts: u32) -> bool {
+        let hash = hash_values(inp);
+        let Ok(entry) = self.table.find_entry(hash, search_for!(self, hash, inp)) else {
+            return false;
+        };
+        let (TableOffset { off, .. }, _) = entry.remove();
+        self.vals[off].0.stale_at = ts;
+        self.n_stale += 1;
+        true
+    }
+
+    /// Returns the entries at the given index if the entry is live (and possibly not subsumed) and the index in bounds.
+    pub(crate) fn get_index(
+        &self,
+        i: usize,
+        include_subsumed: bool,
+    ) -> Option<(&[Value], &TupleOutput)> {
+        let (inp, out) = self.vals.get(i)?;
+        if !valid_value(inp, out, include_subsumed) {
+            return None;
+        }
+        Some((inp.data(), out))
+    }
+
+    /// Iterate over the live entries in the table, in insertion order.
+    pub(crate) fn iter(
+        &self,
+        include_subsumed: bool,
+    ) -> impl Iterator<Item = (&[Value], &TupleOutput)> + '_ {
+        self.iter_range(0..self.num_offsets(), include_subsumed)
+            .map(|(_, y, z)| (y, z))
+    }
+
+    /// Iterate over the live entries in the offset range, passing back the
+    /// offset corresponding to each entry.
+    pub(crate) fn iter_range(
+        &self,
+        range: Range<usize>,
+        include_subsumed: bool,
+    ) -> impl Iterator<Item = (usize, &[Value], &TupleOutput)> + '_ {
+        self.vals[range.clone()]
+            .iter()
+            .zip(range)
+            .filter_map(move |((inp, out), i)| {
+                if valid_value(inp, out, include_subsumed) {
+                    Some((i, inp.data(), out))
+                } else {
+                    None
+                }
+            })
+    }
+
+    #[cfg(debug_assertions)]
+    pub(crate) fn assert_sorted(&self) {
+        assert!(self
+            .vals
+            .windows(2)
+            .all(|xs| xs[0].1.timestamp <= xs[1].1.timestamp))
+    }
+
+    /// Iterate over the live entries in the timestamp range, passing back their
+    /// offset into the table.
+    pub(crate) fn iter_timestamp_range(
+        &self,
+        range: &Range<u32>,
+        include_subsumed: bool,
+    ) -> impl Iterator<Item = (usize, &[Value], &TupleOutput)> + '_ {
+        let indexes = self.transform_range(range);
+        self.iter_range(indexes, include_subsumed)
+    }
+
+    /// Return the approximate number of entries in the table for the given
+    /// timestamp range.
+    pub(crate) fn approximate_range_size(&self, range: &Range<u32>) -> usize {
+        let indexes = self.transform_range(range);
+        indexes.end - indexes.start
+    }
+
+    /// Transform a range of timestamps to the corresponding range of indexes
+    /// into the table.
+    pub(crate) fn transform_range(&self, range: &Range<u32>) -> Range<usize> {
+        if let Some(start) = binary_search_table_by_key(self, range.start) {
+            if let Some(end) = binary_search_table_by_key(self, range.end) {
+                start..end
+            } else {
+                start..self.num_offsets()
+            }
+        } else {
+            0..0
+        }
+    }
+}
+
+/// Returns whether the given value is live and not subsume (if the include_subsumed flag is false).
+///
+/// For checks, debugging, and serialization, we do want to include subsumed values.
+/// but for matching on rules, we do not.
+fn valid_value(input: &Input, output: &TupleOutput, include_subsumed: bool) -> bool {
+    input.live() && (include_subsumed || !output.subsumed)
+}
+
+pub(crate) fn hash_values(vs: &[Value]) -> u64 {
+    // Just hash the bits: all inputs to the same function should have matching
+    // column types.
+    let mut hasher = BH::default().build_hasher();
+    for v in vs {
+        v.bits.hash(&mut hasher);
+    }
+    hasher.finish()
+}
+
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub(crate) struct Input {
+    pub(crate) data: ValueVec,
+    /// The timestamp at which the given input became "stale"
+    stale_at: u32,
+}
+
+impl Input {
+    fn new(data: ValueVec) -> Input {
+        Input {
+            data,
+            stale_at: u32::MAX,
+        }
+    }
+
+    fn data(&self) -> &[Value] {
+        self.data.as_slice()
+    }
+
+    fn live(&self) -> bool {
+        self.stale_at == u32::MAX
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/gj.rs.html b/docs/src/egglog/gj.rs.html new file mode 100644 index 00000000..71f99d66 --- /dev/null +++ b/docs/src/egglog/gj.rs.html @@ -0,0 +1,2009 @@ +gj.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+
use indexmap::map::Entry;
+use log::log_enabled;
+use smallvec::SmallVec;
+use util::HashMap;
+
+use crate::{core::*, function::index::Offset, *};
+use std::{
+    cell::UnsafeCell,
+    fmt::{self, Debug},
+    ops::Range,
+};
+
+type Query = crate::core::Query<ResolvedCall, Symbol>;
+
+#[derive(Clone, Debug)]
+enum Instr<'a> {
+    Intersect {
+        value_idx: usize,
+        variable_name: Symbol,
+        info: VarInfo2,
+        trie_accesses: Vec<(usize, TrieAccess<'a>)>,
+    },
+    ConstrainConstant {
+        index: usize,
+        val: Value,
+        trie_access: TrieAccess<'a>,
+    },
+    Call {
+        prim: SpecializedPrimitive,
+        args: Vec<AtomTerm>,
+        check: bool, // check or assign to output variable
+    },
+}
+
+// FIXME @mwillsey awful name, bad bad bad
+#[derive(Default, Debug, Clone)]
+struct VarInfo2 {
+    occurences: Vec<usize>,
+    intersected_on: usize,
+    size_guess: usize,
+}
+
+struct InputSizes<'a> {
+    cur_stage: usize,
+    // a map from from stage to vector of costs for each stage,
+    // where 'cost' is the largest relation being intersected
+    stage_sizes: &'a mut HashMap<usize, Vec<usize>>,
+}
+
+impl<'a> InputSizes<'a> {
+    fn add_measurement(&mut self, max_size: usize) {
+        self.stage_sizes
+            .entry(self.cur_stage)
+            .or_default()
+            .push(max_size);
+    }
+
+    fn next(&mut self) -> InputSizes {
+        InputSizes {
+            cur_stage: self.cur_stage + 1,
+            stage_sizes: self.stage_sizes,
+        }
+    }
+}
+
+type Result = std::result::Result<(), ()>;
+
+struct Program<'a>(Vec<Instr<'a>>);
+
+impl<'a> std::fmt::Display for Instr<'a> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        match self {
+            Instr::Intersect {
+                value_idx,
+                trie_accesses,
+                variable_name,
+                info,
+            } => {
+                write!(
+                    f,
+                    " Intersect @ {value_idx} sg={sg:6} {variable_name:15}",
+                    sg = info.size_guess
+                )?;
+                for (trie_idx, a) in trie_accesses {
+                    write!(f, "  {trie_idx}: {a}")?;
+                }
+                writeln!(f)?
+            }
+            Instr::ConstrainConstant {
+                index,
+                val,
+                trie_access,
+            } => {
+                writeln!(f, " ConstrainConstant {index} {trie_access} = {val:?}")?;
+            }
+            Instr::Call { prim, args, check } => {
+                writeln!(f, " Call {:?} {:?} {:?}", prim, args, check)?;
+            }
+        }
+        Ok(())
+    }
+}
+
+impl<'a> std::fmt::Display for Program<'a> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        for (i, instr) in self.0.iter().enumerate() {
+            write!(f, "{i:2}. {instr}")?;
+        }
+        Ok(())
+    }
+}
+
+struct Context<'b> {
+    query: &'b CompiledQuery,
+    join_var_ordering: Vec<Symbol>,
+    tuple: Vec<Value>,
+    matches: usize,
+    egraph: &'b EGraph,
+}
+
+impl<'b> Context<'b> {
+    fn new(
+        egraph: &'b EGraph,
+        cq: &'b CompiledQuery,
+        timestamp_ranges: &[Range<u32>],
+        include_subsumed: bool,
+    ) -> Option<(Self, Program<'b>, Vec<Option<usize>>)> {
+        let (program, join_var_ordering, intersections) =
+            egraph.compile_program(cq, timestamp_ranges, include_subsumed)?;
+
+        let ctx = Context {
+            query: cq,
+            tuple: vec![Value::fake(); cq.vars.len()],
+            join_var_ordering,
+            matches: 0,
+            egraph,
+        };
+
+        Some((ctx, program, intersections))
+    }
+
+    fn eval<F>(
+        &mut self,
+        tries: &mut [&LazyTrie],
+        program: &[Instr],
+        mut stage: InputSizes,
+        f: &mut F,
+    ) -> Result
+    where
+        F: FnMut(&[Value]) -> Result,
+    {
+        let (instr, program) = match program.split_first() {
+            None => {
+                self.matches += 1;
+                return f(&self.tuple);
+            }
+            Some(pair) => pair,
+        };
+
+        match instr {
+            Instr::ConstrainConstant {
+                index,
+                val,
+                trie_access,
+            } => {
+                if let Some(next) = tries[*index].get(trie_access, *val) {
+                    let old = tries[*index];
+                    tries[*index] = next;
+                    self.eval(tries, program, stage.next(), f)?;
+                    tries[*index] = old;
+                }
+                Ok(())
+            }
+            Instr::Intersect {
+                value_idx,
+                trie_accesses,
+                ..
+            } => {
+                if let Some(x) = trie_accesses
+                    .iter()
+                    .map(|(atom, _)| tries[*atom].len())
+                    .max()
+                {
+                    stage.add_measurement(x);
+                }
+
+                match trie_accesses.as_slice() {
+                    [(j, access)] => tries[*j].for_each(access, |value, trie| {
+                        let old_trie = std::mem::replace(&mut tries[*j], trie);
+                        self.tuple[*value_idx] = value;
+                        self.eval(tries, program, stage.next(), f)?;
+                        tries[*j] = old_trie;
+                        Ok(())
+                    }),
+                    [a, b] => {
+                        let (a, b) = if tries[a.0].len() <= tries[b.0].len() {
+                            (a, b)
+                        } else {
+                            (b, a)
+                        };
+                        tries[a.0].for_each(&a.1, |value, ta| {
+                            if let Some(tb) = tries[b.0].get(&b.1, value) {
+                                let old_ta = std::mem::replace(&mut tries[a.0], ta);
+                                let old_tb = std::mem::replace(&mut tries[b.0], tb);
+                                self.tuple[*value_idx] = value;
+                                self.eval(tries, program, stage.next(), f)?;
+                                tries[a.0] = old_ta;
+                                tries[b.0] = old_tb;
+                            }
+                            Ok(())
+                        })
+                    }
+                    _ => {
+                        let (j_min, access_min) = trie_accesses
+                            .iter()
+                            .min_by_key(|(j, _a)| tries[*j].len())
+                            .unwrap();
+
+                        let mut new_tries = tries.to_vec();
+
+                        tries[*j_min].for_each(access_min, |value, min_trie| {
+                            new_tries[*j_min] = min_trie;
+                            for (j, access) in trie_accesses {
+                                if j != j_min {
+                                    if let Some(t) = tries[*j].get(access, value) {
+                                        new_tries[*j] = t;
+                                    } else {
+                                        return Ok(());
+                                    }
+                                }
+                            }
+
+                            // at this point, new_tries is ready to go
+                            self.tuple[*value_idx] = value;
+                            self.eval(&mut new_tries, program, stage.next(), f)
+                        })
+                    }
+                }
+            }
+            Instr::Call { prim, args, check } => {
+                let (out, args) = args.split_last().unwrap();
+                let mut values: Vec<Value> = vec![];
+                for arg in args {
+                    values.push(match arg {
+                        AtomTerm::Var(_ann, v) => {
+                            let i = self.query.vars.get_index_of(v).unwrap();
+                            self.tuple[i]
+                        }
+                        AtomTerm::Literal(_ann, lit) => self.egraph.eval_lit(lit),
+                        AtomTerm::Global(_ann, _g) => panic!("Globals should have been desugared"),
+                    })
+                }
+
+                if let Some(res) = prim
+                    .primitive
+                    .apply(&values, (&prim.input, &prim.output), None)
+                {
+                    match out {
+                        AtomTerm::Var(_ann, v) => {
+                            let i = self.query.vars.get_index_of(v).unwrap();
+
+                            if *check {
+                                assert_ne!(self.tuple[i], Value::fake());
+                                if self.tuple[i] != res {
+                                    return Ok(());
+                                }
+                            }
+
+                            self.tuple[i] = res;
+                        }
+                        AtomTerm::Literal(_ann, lit) => {
+                            assert!(check);
+                            let val = &self.egraph.eval_lit(lit);
+                            if val != &res {
+                                return Ok(());
+                            }
+                        }
+                        AtomTerm::Global(_ann, _g) => {
+                            panic!("Globals should have been desugared")
+                        }
+                    }
+                    self.eval(tries, program, stage.next(), f)?;
+                }
+
+                Ok(())
+            }
+        }
+    }
+}
+
+#[derive(Clone, Debug)]
+enum Constraint {
+    Eq(usize, usize),
+    Const(usize, Value),
+}
+
+impl Constraint {
+    fn check(&self, tuple: &[Value], out: &TupleOutput) -> bool {
+        let get = |i: usize| {
+            if i < tuple.len() {
+                &tuple[i]
+            } else {
+                debug_assert_eq!(i, tuple.len());
+                &out.value
+            }
+        };
+        match self {
+            Constraint::Eq(i, j) => get(*i) == get(*j),
+            Constraint::Const(i, t) => get(*i) == t,
+        }
+    }
+}
+
+#[derive(Debug, Default, Clone)]
+pub struct VarInfo {
+    /// indexes into the `atoms` field of CompiledQuery
+    occurences: Vec<usize>,
+}
+
+#[derive(Debug, Clone)]
+pub struct CompiledQuery {
+    query: Query,
+    // Ordering is used for the tuple
+    // The GJ variable ordering is stored in the context
+    pub vars: IndexMap<Symbol, VarInfo>,
+}
+
+impl EGraph {
+    pub(crate) fn compile_gj_query(
+        &self,
+        // TODO: The legacy code uses Query<ResolvedCall, Symbol>
+        // instead of Query<ResolvedCall, ResolvedVar>, so we do
+        // the manual conversion here.
+        // This needs to be fixed in the future.
+        query: core::Query<ResolvedCall, ResolvedVar>,
+        ordering: &IndexSet<ResolvedVar>,
+    ) -> CompiledQuery {
+        // NOTE: this vars order only used for ordering the tuple storing the resulting match
+        // It is not the GJ variable order.
+        let mut vars: IndexMap<Symbol, VarInfo> = Default::default();
+        for var in ordering.iter() {
+            vars.entry(var.name).or_default();
+        }
+
+        for (i, atom) in query.funcs().enumerate() {
+            for v in atom.vars() {
+                // only count grounded occurrences
+                vars.entry(v.to_symbol()).or_default().occurences.push(i)
+            }
+        }
+
+        // make sure everyone has an entry in the vars table
+        for prim in query.filters() {
+            for v in prim.vars() {
+                vars.entry(v.to_symbol()).or_default();
+            }
+        }
+
+        let atoms = query
+            .atoms
+            .into_iter()
+            .map(|atom| {
+                let args = atom.args.into_iter().map(|arg| match arg {
+                    ResolvedAtomTerm::Var(span, v) => AtomTerm::Var(span, v.name),
+                    ResolvedAtomTerm::Literal(span, lit) => AtomTerm::Literal(span, lit),
+                    ResolvedAtomTerm::Global(span, g) => AtomTerm::Global(span, g.name),
+                });
+                Atom {
+                    span: atom.span,
+                    head: atom.head,
+                    args: args.collect(),
+                }
+            })
+            .collect();
+        let query = Query { atoms };
+
+        CompiledQuery { query, vars }
+    }
+
+    fn make_trie_access_for_column(
+        &self,
+        atom: &Atom<Symbol>,
+        column: usize,
+        timestamp_range: Range<u32>,
+        include_subsumed: bool,
+    ) -> TrieAccess {
+        let function = &self.functions[&atom.head];
+
+        let mut constraints = vec![];
+        for (i, t) in atom.args.iter().enumerate() {
+            match t {
+                AtomTerm::Literal(_ann, lit) => {
+                    let val = self.eval_lit(lit);
+                    constraints.push(Constraint::Const(i, val))
+                }
+                AtomTerm::Global(_ann, _g) => {
+                    panic!("Globals should have been desugared")
+                }
+                AtomTerm::Var(_ann, _v) => {
+                    if let Some(j) = atom.args[..i].iter().position(|t2| t == t2) {
+                        constraints.push(Constraint::Eq(j, i));
+                    }
+                }
+            }
+        }
+
+        TrieAccess {
+            function,
+            timestamp_range,
+            column,
+            constraints,
+            include_subsumed,
+        }
+    }
+
+    fn make_trie_access(
+        &self,
+        var: Symbol,
+        atom: &Atom<Symbol>,
+        timestamp_range: Range<u32>,
+        include_subsumed: bool,
+    ) -> TrieAccess {
+        let column = atom
+            .args
+            .iter()
+            .position(|arg| {
+                if let AtomTerm::Var(_, var2) = arg {
+                    &var == var2
+                } else {
+                    false
+                }
+            })
+            .unwrap();
+        self.make_trie_access_for_column(atom, column, timestamp_range, include_subsumed)
+    }
+
+    // Returns `None` when no program is needed,
+    // for example when there is nothing in one of the tables.
+    fn compile_program(
+        &self,
+        query: &CompiledQuery,
+        timestamp_ranges: &[Range<u32>],
+        include_subsumed: bool,
+    ) -> Option<(
+        Program,
+        Vec<Symbol>,        /* variable ordering */
+        Vec<Option<usize>>, /* the first column accessed per-atom */
+    )> {
+        let atoms: &Vec<_> = &query.query.funcs().collect();
+        let mut vars: IndexMap<Symbol, VarInfo2> = Default::default();
+        let mut constants =
+            IndexMap::<usize /* atom */, Vec<(usize /* column */, Value)>>::default();
+
+        for (i, atom) in atoms.iter().enumerate() {
+            for (col, arg) in atom.args.iter().enumerate() {
+                match arg {
+                    AtomTerm::Var(_ann, var) => vars.entry(*var).or_default().occurences.push(i),
+                    AtomTerm::Literal(_ann, lit) => {
+                        let val = self.eval_lit(lit);
+                        constants.entry(i).or_default().push((col, val));
+                    }
+                    AtomTerm::Global(_ann, _g) => {
+                        panic!("Globals should have been desugared")
+                    }
+                }
+            }
+        }
+
+        for info in vars.values_mut() {
+            info.occurences.sort_unstable();
+            info.occurences.dedup();
+        }
+
+        let relation_sizes: Vec<usize> = atoms
+            .iter()
+            .zip(timestamp_ranges)
+            .map(|(atom, range)| self.functions[&atom.head].get_size(range))
+            .collect();
+
+        if relation_sizes.iter().any(|&s| s == 0) {
+            return None;
+        }
+
+        for (_v, info) in &mut vars {
+            assert!(!info.occurences.is_empty());
+            info.size_guess = info
+                .occurences
+                .iter()
+                .map(|&i| relation_sizes[i])
+                .min()
+                .unwrap();
+            // info.size_guess >>= info.occurences.len() - 1;
+        }
+
+        // here we are picking the variable ordering
+        let mut ordered_vars = IndexMap::default();
+        while !vars.is_empty() {
+            let mut var_cost = vars
+                .iter()
+                .map(|(v, info)| {
+                    let size = info.size_guess as isize;
+                    let cost = (info.occurences.len(), info.intersected_on, -size);
+                    (cost, v)
+                })
+                .collect::<Vec<_>>();
+            var_cost.sort();
+            var_cost.reverse();
+
+            log::debug!("Variable costs: {:?}", ListDebug(&var_cost, "\n"));
+
+            let var = *var_cost[0].1;
+            let info = vars.swap_remove(&var).unwrap();
+            for &i in &info.occurences {
+                for v in atoms[i].vars() {
+                    if let Some(info) = vars.get_mut(&v) {
+                        info.intersected_on += 1;
+                    }
+                }
+            }
+
+            ordered_vars.insert(var, info);
+        }
+        vars = ordered_vars;
+
+        let mut initial_columns = vec![None; atoms.len()];
+        let const_instrs = constants.iter().flat_map(|(atom, consts)| {
+            let initial_col = &mut initial_columns[*atom];
+            if initial_col.is_none() {
+                *initial_col = Some(consts[0].0);
+            }
+            consts.iter().map(|(col, val)| {
+                let range = timestamp_ranges[*atom].clone();
+                let trie_access =
+                    self.make_trie_access_for_column(&atoms[*atom], *col, range, include_subsumed);
+
+                Instr::ConstrainConstant {
+                    index: *atom,
+                    val: *val,
+                    trie_access,
+                }
+            })
+        });
+        let mut program: Vec<Instr> = const_instrs.collect();
+
+        let var_instrs = vars.iter().map(|(&v, info)| {
+            let value_idx = query.vars.get_index_of(&v).unwrap_or_else(|| {
+                panic!("variable {} not found in query", v);
+            });
+            Instr::Intersect {
+                value_idx,
+                variable_name: v,
+                info: info.clone(),
+                trie_accesses: info
+                    .occurences
+                    .iter()
+                    .map(|&atom_idx| {
+                        let atom = &atoms[atom_idx];
+                        let range = timestamp_ranges[atom_idx].clone();
+                        let access = self.make_trie_access(v, atom, range, include_subsumed);
+                        let initial_col = &mut initial_columns[atom_idx];
+                        if initial_col.is_none() {
+                            *initial_col = Some(access.column);
+                        }
+                        (atom_idx, access)
+                    })
+                    .collect(),
+            }
+        });
+        program.extend(var_instrs);
+
+        // now we can try to add primitives
+        let mut extra: Vec<_> = query.query.filters().collect();
+        while !extra.is_empty() {
+            let next = extra.iter().position(|p| {
+                assert!(!p.args.is_empty());
+                p.args[..p.args.len() - 1].iter().all(|a| match a {
+                    AtomTerm::Var(_ann, v) => vars.contains_key(v),
+                    AtomTerm::Literal(_ann, _) => true,
+                    AtomTerm::Global(_ann, _) => true,
+                })
+            });
+
+            if let Some(i) = next {
+                let p = extra.remove(i);
+                let check = match p.args.last().unwrap() {
+                    AtomTerm::Var(_ann, v) => match vars.entry(*v) {
+                        Entry::Occupied(_) => true,
+                        Entry::Vacant(e) => {
+                            e.insert(Default::default());
+                            false
+                        }
+                    },
+                    AtomTerm::Literal(_ann, _) => true,
+                    AtomTerm::Global(_ann, _) => true,
+                };
+                program.push(Instr::Call {
+                    prim: p.head.clone(),
+                    args: p.args.clone(),
+                    check,
+                });
+            } else {
+                panic!("cycle {:#?}", query)
+            }
+        }
+
+        let resulting_program = Program(program);
+        self.sanity_check_program(&resulting_program, query);
+
+        Some((
+            resulting_program,
+            vars.into_keys().collect(),
+            initial_columns,
+        ))
+    }
+
+    fn sanity_check_program(&self, program: &Program, query: &CompiledQuery) {
+        // sanity check the program
+        let mut tuple_valid = vec![false; query.vars.len()];
+        for instr in &program.0 {
+            match instr {
+                Instr::Intersect { value_idx, .. } => {
+                    assert!(!tuple_valid[*value_idx]);
+                    tuple_valid[*value_idx] = true;
+                }
+                Instr::ConstrainConstant { .. } => {}
+                Instr::Call { check, args, .. } => {
+                    let Some((last, args)) = args.split_last() else {
+                        continue;
+                    };
+
+                    for a in args {
+                        if let AtomTerm::Var(_ann, v) = a {
+                            let i = query.vars.get_index_of(v).unwrap();
+                            assert!(tuple_valid[i]);
+                        }
+                    }
+
+                    match last {
+                        AtomTerm::Var(_ann, v) => {
+                            let i = query.vars.get_index_of(v).unwrap();
+                            assert_eq!(*check, tuple_valid[i], "{instr}");
+                            if !*check {
+                                tuple_valid[i] = true;
+                            }
+                        }
+                        AtomTerm::Literal(_ann, _) => {
+                            assert!(*check);
+                        }
+                        AtomTerm::Global(_ann, _) => {
+                            assert!(*check);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    fn gj_for_atom<F>(
+        &self,
+        // for debugging, the atom seminaive is focusing on
+        atom_i: Option<usize>,
+        timestamp_ranges: &[Range<u32>],
+        cq: &CompiledQuery,
+        include_subsumed: bool,
+        mut f: F,
+    ) where
+        F: FnMut(&[Value]) -> Result,
+    {
+        // do the gj
+        if let Some((mut ctx, program, cols)) =
+            Context::new(self, cq, timestamp_ranges, include_subsumed)
+        {
+            let start = Instant::now();
+            let atom_info = if let Some(atom_i) = atom_i {
+                let atom = &cq.query.funcs().collect::<Vec<_>>()[atom_i];
+                format!("New atom: {atom}")
+            } else {
+                "Seminaive disabled".to_string()
+            };
+            log::debug!(
+                "Query:\n{q}\n{atom_info}\nTuple: {tuple}\nJoin order: {order}\nProgram\n{program}",
+                q = cq.query,
+                order = ListDisplay(&ctx.join_var_ordering, " "),
+                tuple = ListDisplay(cq.vars.keys(), " "),
+            );
+            let mut tries = Vec::with_capacity(cq.query.funcs().collect::<Vec<_>>().len());
+            for ((atom, ts), col) in cq
+                .query
+                .funcs()
+                .zip(timestamp_ranges.iter())
+                .zip(cols.iter())
+            {
+                // tries.push(LazyTrie::default());
+                if let Some(target) = col {
+                    if let Some(col) = self.functions[&atom.head].column_index(*target, ts) {
+                        tries.push(LazyTrie::from_column_index(col))
+                    } else {
+                        tries.push(LazyTrie::default());
+                    }
+                } else {
+                    tries.push(LazyTrie::default());
+                }
+            }
+            let mut trie_refs = tries.iter().collect::<Vec<_>>();
+            let mut meausrements = HashMap::<usize, Vec<usize>>::default();
+            let stages = InputSizes {
+                stage_sizes: &mut meausrements,
+                cur_stage: 0,
+            };
+            ctx.eval(&mut trie_refs, &program.0, stages, &mut f)
+                .unwrap_or(());
+            let mut sums = Vec::from_iter(
+                meausrements
+                    .iter()
+                    .map(|(x, y)| (*x, y.iter().copied().sum::<usize>())),
+            );
+            sums.sort_by_key(|(i, _sum)| *i);
+            if log_enabled!(log::Level::Debug) {
+                for (i, sum) in sums {
+                    log::debug!("stage {i} total cost {sum}");
+                }
+            }
+            let duration = start.elapsed();
+            log::debug!("Matched {} times (took {:?})", ctx.matches, duration,);
+            if duration.as_millis() > 1000 {
+                log::warn!("Query took a long time: {:?}", duration);
+            }
+        }
+    }
+
+    pub(crate) fn run_query<F>(
+        &self,
+        cq: &CompiledQuery,
+        timestamp: u32,
+        include_subsumed: bool,
+        mut f: F,
+    ) where
+        F: FnMut(&[Value]) -> Result,
+    {
+        let has_atoms = !cq.query.funcs().collect::<Vec<_>>().is_empty();
+
+        if has_atoms {
+            for atom in cq.query.funcs() {
+                for arg in &atom.args {
+                    if let AtomTerm::Global(_ann, _g) = arg {
+                        panic!("Globals should have been desugared")
+                    }
+                }
+            }
+
+            let do_seminaive = self.seminaive;
+            // for the later atoms, we consider everything
+            let mut timestamp_ranges =
+                vec![0..u32::MAX; cq.query.funcs().collect::<Vec<_>>().len()];
+            if do_seminaive {
+                for (atom_i, _atom) in cq.query.funcs().enumerate() {
+                    timestamp_ranges[atom_i] = timestamp..u32::MAX;
+
+                    self.gj_for_atom(
+                        Some(atom_i),
+                        &timestamp_ranges,
+                        cq,
+                        include_subsumed,
+                        &mut f,
+                    );
+                    // now we can fix this atom to be "old stuff" only
+                    // range is half-open; timestamp is excluded
+                    timestamp_ranges[atom_i] = 0..timestamp;
+                }
+            } else {
+                self.gj_for_atom(None, &timestamp_ranges, cq, include_subsumed, &mut f);
+            }
+        } else if let Some((mut ctx, program, _)) = Context::new(self, cq, &[], include_subsumed) {
+            let mut meausrements = HashMap::<usize, Vec<usize>>::default();
+            let stages = InputSizes {
+                stage_sizes: &mut meausrements,
+                cur_stage: 0,
+            };
+            let tries = LazyTrie::make_initial_vec(cq.query.funcs().collect::<Vec<_>>().len()); // TODO: bad use of collect here
+            let mut trie_refs = tries.iter().collect::<Vec<_>>();
+            ctx.eval(&mut trie_refs, &program.0, stages, &mut f)
+                .unwrap_or(());
+        }
+    }
+}
+
+struct LazyTrie(UnsafeCell<LazyTrieInner>);
+
+impl Debug for LazyTrie {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        Debug::fmt(unsafe { &*self.0.get() }, f)
+    }
+}
+
+type RowIdx = u32;
+
+#[derive(Debug)]
+enum LazyTrieInner {
+    Borrowed {
+        index: Rc<ColumnIndex>,
+        map: HashMap<Value, LazyTrie>,
+    },
+    Delayed(SmallVec<[RowIdx; 4]>),
+    Sparse(HashMap<Value, LazyTrie>),
+}
+
+impl Default for LazyTrie {
+    fn default() -> Self {
+        LazyTrie(UnsafeCell::new(LazyTrieInner::Delayed(Default::default())))
+    }
+}
+
+impl LazyTrie {
+    fn make_initial_vec(n: usize) -> Vec<Self> {
+        (0..n).map(|_| LazyTrie::default()).collect()
+    }
+
+    fn len(&self) -> usize {
+        match unsafe { &*self.0.get() } {
+            LazyTrieInner::Delayed(v) => v.len(),
+            LazyTrieInner::Sparse(m) => m.len(),
+            LazyTrieInner::Borrowed { index, .. } => index.len(),
+        }
+    }
+    fn from_column_index(index: Rc<ColumnIndex>) -> LazyTrie {
+        LazyTrie(UnsafeCell::new(LazyTrieInner::Borrowed {
+            index,
+            map: Default::default(),
+        }))
+    }
+    fn from_indexes(ixs: impl Iterator<Item = usize>) -> Option<LazyTrie> {
+        let data = SmallVec::from_iter(ixs.map(|x| x as RowIdx));
+        if data.is_empty() {
+            return None;
+        }
+
+        Some(LazyTrie(UnsafeCell::new(LazyTrieInner::Delayed(data))))
+    }
+
+    unsafe fn force_mut(&self, access: &TrieAccess) -> *mut LazyTrieInner {
+        let this = &mut *self.0.get();
+        if let LazyTrieInner::Delayed(idxs) = this {
+            *this = access.make_trie_inner(idxs);
+        }
+        self.0.get()
+    }
+
+    fn force_borrowed(&self, access: &TrieAccess) -> &LazyTrieInner {
+        let this = unsafe { &mut *self.0.get() };
+        match this {
+            LazyTrieInner::Borrowed { index, .. } => {
+                let mut map = HashMap::with_capacity_and_hasher(index.len(), Default::default());
+                map.extend(index.iter().filter_map(|(v, ixs)| {
+                    LazyTrie::from_indexes(access.filter_live(ixs)).map(|trie| (v, trie))
+                }));
+                *this = LazyTrieInner::Sparse(map);
+            }
+            LazyTrieInner::Delayed(idxs) => {
+                *this = access.make_trie_inner(idxs);
+            }
+            LazyTrieInner::Sparse(_) => {}
+        }
+        unsafe { &*self.0.get() }
+    }
+
+    fn for_each<'a>(
+        &'a self,
+        access: &TrieAccess,
+        mut f: impl FnMut(Value, &'a LazyTrie) -> Result,
+    ) -> Result {
+        // There is probably something cleaner to do here compared with the
+        // `force_borrowed` construct.
+        match self.force_borrowed(access) {
+            LazyTrieInner::Sparse(m) => {
+                for (k, v) in m {
+                    f(*k, v)?;
+                }
+                Ok(())
+            }
+            LazyTrieInner::Borrowed { .. } | LazyTrieInner::Delayed(_) => unreachable!(),
+        }
+    }
+
+    fn get(&self, access: &TrieAccess, value: Value) -> Option<&LazyTrie> {
+        match unsafe { &mut *self.force_mut(access) } {
+            LazyTrieInner::Sparse(m) => m.get(&value),
+            LazyTrieInner::Borrowed { index, map } => {
+                let ixs = index.get(&value)?;
+                match map.entry(value) {
+                    HEntry::Occupied(o) => Some(o.into_mut()),
+                    HEntry::Vacant(v) => {
+                        Some(v.insert(LazyTrie::from_indexes(access.filter_live(ixs))?))
+                    }
+                }
+            }
+            LazyTrieInner::Delayed(_) => unreachable!(),
+        }
+    }
+}
+
+#[derive(Clone, Debug)]
+struct TrieAccess<'a> {
+    function: &'a Function,
+    timestamp_range: Range<u32>,
+    column: usize,
+    constraints: Vec<Constraint>,
+    // If we are querying to run a rule, we should not include subsumed expressions
+    // but if we are querying to run a check we can include them.
+    // So we have a flag to control this behavior and pass it down to here.
+    include_subsumed: bool,
+}
+
+impl<'a> std::fmt::Display for TrieAccess<'a> {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(f, "{}.{}", self.function.decl.name, self.column)
+    }
+}
+
+impl<'a> TrieAccess<'a> {
+    fn filter_live<'b: 'a>(&'b self, ixs: &'b [Offset]) -> impl Iterator<Item = usize> + 'a {
+        ixs.iter().copied().filter_map(move |ix| {
+            let ix = ix as usize;
+            let (inp, out) = self.function.nodes.get_index(ix, self.include_subsumed)?;
+            if self.timestamp_range.contains(&out.timestamp)
+                && self.constraints.iter().all(|c| c.check(inp, out))
+            {
+                Some(ix)
+            } else {
+                None
+            }
+        })
+    }
+
+    #[cold]
+    fn make_trie_inner(&self, idxs: &[RowIdx]) -> LazyTrieInner {
+        let arity = self.function.schema.input.len();
+        let mut map: HashMap<Value, LazyTrie> = HashMap::default();
+        let mut insert = |i: usize, tup: &[Value], out: &TupleOutput, val: Value| {
+            if self.timestamp_range.contains(&out.timestamp)
+                && self.constraints.iter().all(|c| c.check(tup, out))
+            {
+                match map.entry(val) {
+                    HEntry::Occupied(mut e) => {
+                        if let LazyTrieInner::Delayed(ref mut v) = e.get_mut().0.get_mut() {
+                            v.push(i as RowIdx)
+                        } else {
+                            unreachable!()
+                        }
+                    }
+                    HEntry::Vacant(e) => {
+                        e.insert(LazyTrie(UnsafeCell::new(LazyTrieInner::Delayed(
+                            smallvec::smallvec![i as RowIdx,],
+                        ))));
+                    }
+                }
+            }
+        };
+
+        if idxs.is_empty() {
+            let rows = self
+                .function
+                .iter_timestamp_range(&self.timestamp_range, true);
+            if self.column < arity {
+                for (i, tup, out) in rows {
+                    insert(i, tup, out, tup[self.column])
+                }
+            } else {
+                assert_eq!(self.column, arity);
+                for (i, tup, out) in rows {
+                    insert(i, tup, out, out.value);
+                }
+            };
+        } else if self.column < arity {
+            for idx in idxs {
+                let i = *idx as usize;
+                if let Some((tup, out)) = self.function.nodes.get_index(i, self.include_subsumed) {
+                    insert(i, tup, out, tup[self.column])
+                }
+            }
+        } else {
+            assert_eq!(self.column, arity);
+            for idx in idxs {
+                let i = *idx as usize;
+                if let Some((tup, out)) = self.function.nodes.get_index(i, self.include_subsumed) {
+                    insert(i, tup, out, out.value)
+                }
+            }
+        }
+
+        // // Density test
+        // if !map.is_empty() {
+        //     let min = map.keys().map(|v| v.bits).min().unwrap();
+        //     let max = map.keys().map(|v| v.bits).max().unwrap();
+        //     let len = map.len();
+        //     if max - min <= len as u64 * 2 {
+        //         println!("Trie is dense with len {len}!");
+        //     } else {
+        //         println!("Trie is not dense with len {len}!");
+        //     }
+        // }
+
+        LazyTrieInner::Sparse(map)
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/lib.rs.html b/docs/src/egglog/lib.rs.html new file mode 100644 index 00000000..466c9dc2 --- /dev/null +++ b/docs/src/egglog/lib.rs.html @@ -0,0 +1,3251 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+
//! # egglog
+//! egglog is a language specialized for writing equality saturation
+//! applications. It is the successor to the rust library [egg](https://github.com/egraphs-good/egg).
+//! egglog is faster and more general than egg.
+//!
+//! # Documentation
+//! Documentation for the egglog language can be found
+//! here: [`Command`]
+//!
+//! # Tutorial
+//! [Here](https://www.youtube.com/watch?v=N2RDQGRBrSY) is the video tutorial on what egglog is and how to use it.
+//! We plan to have a text tutorial here soon, PRs welcome!
+//!
+mod actions;
+pub mod ast;
+pub mod constraint;
+mod core;
+mod extract;
+mod function;
+mod gj;
+mod serialize;
+pub mod sort;
+mod termdag;
+mod typechecking;
+mod unionfind;
+pub mod util;
+mod value;
+
+use crate::constraint::Problem;
+use crate::core::{AtomTerm, ResolvedCall};
+use crate::typechecking::TypeError;
+use actions::Program;
+use ast::remove_globals::remove_globals;
+use ast::*;
+use constraint::{Constraint, SimpleTypeConstraint, TypeConstraint};
+use extract::Extractor;
+pub use function::Function;
+use function::*;
+use generic_symbolic_expressions::Sexp;
+use gj::*;
+use index::ColumnIndex;
+use indexmap::map::Entry;
+use instant::{Duration, Instant};
+pub use serialize::{SerializeConfig, SerializedNode};
+use sort::*;
+use std::fmt::{Display, Formatter};
+use std::fs::File;
+use std::hash::Hash;
+use std::io::Read;
+use std::iter::once;
+use std::ops::{Deref, Range};
+use std::path::PathBuf;
+use std::rc::Rc;
+use std::str::FromStr;
+use std::{fmt::Debug, sync::Arc};
+pub use termdag::{Term, TermDag, TermId};
+use thiserror::Error;
+pub use typechecking::TypeInfo;
+use unionfind::*;
+use util::*;
+pub use value::*;
+
+pub type ArcSort = Arc<dyn Sort>;
+
+pub type Subst = IndexMap<Symbol, Value>;
+
+pub trait PrimitiveLike {
+    fn name(&self) -> Symbol;
+    /// Constructs a type constraint for the primitive that uses the span information
+    /// for error localization.
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint>;
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        egraph: Option<&mut EGraph>,
+    ) -> Option<Value>;
+}
+
+/// Running a schedule produces a report of the results.
+/// This includes rough timing information and whether
+/// the database was updated.
+/// Calling `union` on two run reports adds the timing
+/// information together.
+#[derive(Debug, Clone, Default)]
+pub struct RunReport {
+    /// If any changes were made to the database, this is
+    /// true.
+    pub updated: bool,
+    /// The time it took to run the query, for each rule.
+    pub search_time_per_rule: HashMap<Symbol, Duration>,
+    pub apply_time_per_rule: HashMap<Symbol, Duration>,
+    pub search_time_per_ruleset: HashMap<Symbol, Duration>,
+    pub num_matches_per_rule: HashMap<Symbol, usize>,
+    pub apply_time_per_ruleset: HashMap<Symbol, Duration>,
+    pub rebuild_time_per_ruleset: HashMap<Symbol, Duration>,
+}
+
+impl RunReport {
+    /// add a ... and a maximum size to the name
+    /// for printing, since they may be the rule itself
+    fn truncate_rule_name(sym: Symbol) -> String {
+        let mut s = sym.to_string();
+        // replace newlines in s with a space
+        s = s.replace('\n', " ");
+        if s.len() > 80 {
+            s.truncate(80);
+            s.push_str("...");
+        }
+        s
+    }
+
+    fn add_rule_search_time(&mut self, rule: Symbol, time: Duration) {
+        *self.search_time_per_rule.entry(rule).or_default() += time;
+    }
+
+    fn add_ruleset_search_time(&mut self, ruleset: Symbol, time: Duration) {
+        *self.search_time_per_ruleset.entry(ruleset).or_default() += time;
+    }
+
+    fn add_rule_apply_time(&mut self, rule: Symbol, time: Duration) {
+        *self.apply_time_per_rule.entry(rule).or_default() += time;
+    }
+
+    fn add_ruleset_apply_time(&mut self, ruleset: Symbol, time: Duration) {
+        *self.apply_time_per_ruleset.entry(ruleset).or_default() += time;
+    }
+
+    fn add_ruleset_rebuild_time(&mut self, ruleset: Symbol, time: Duration) {
+        *self.rebuild_time_per_ruleset.entry(ruleset).or_default() += time;
+    }
+
+    fn add_rule_num_matches(&mut self, rule: Symbol, num_matches: usize) {
+        *self.num_matches_per_rule.entry(rule).or_default() += num_matches;
+    }
+}
+
+impl Display for RunReport {
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        let all_rules = self
+            .search_time_per_rule
+            .keys()
+            .chain(self.apply_time_per_rule.keys())
+            .collect::<HashSet<_>>();
+        let mut all_rules_vec = all_rules.iter().cloned().collect::<Vec<_>>();
+        // sort rules by search and apply time
+        all_rules_vec.sort_by_key(|rule| {
+            let search_time = self
+                .search_time_per_rule
+                .get(*rule)
+                .cloned()
+                .unwrap_or(Duration::default())
+                .as_millis();
+            let apply_time = self
+                .apply_time_per_rule
+                .get(*rule)
+                .cloned()
+                .unwrap_or(Duration::default())
+                .as_millis();
+            search_time + apply_time
+        });
+
+        for rule in all_rules_vec {
+            let truncated = Self::truncate_rule_name(*rule);
+            // print out the search and apply time for rule
+            let search_time = self
+                .search_time_per_rule
+                .get(rule)
+                .cloned()
+                .unwrap_or(Duration::default())
+                .as_secs_f64();
+            let apply_time = self
+                .apply_time_per_rule
+                .get(rule)
+                .cloned()
+                .unwrap_or(Duration::default())
+                .as_secs_f64();
+            let num_matches = self.num_matches_per_rule.get(rule).cloned().unwrap_or(0);
+            writeln!(
+                f,
+                "Rule {truncated}: search {search_time:.3}s, apply {apply_time:.3}s, num matches {num_matches}",
+            )?;
+        }
+
+        let rulesets = self
+            .search_time_per_ruleset
+            .keys()
+            .chain(self.apply_time_per_ruleset.keys())
+            .chain(self.rebuild_time_per_ruleset.keys())
+            .collect::<HashSet<_>>();
+
+        for ruleset in rulesets {
+            // print out the search and apply time for rule
+            let search_time = self
+                .search_time_per_ruleset
+                .get(ruleset)
+                .cloned()
+                .unwrap_or(Duration::default())
+                .as_secs_f64();
+            let apply_time = self
+                .apply_time_per_ruleset
+                .get(ruleset)
+                .cloned()
+                .unwrap_or(Duration::default())
+                .as_secs_f64();
+            let rebuild_time = self
+                .rebuild_time_per_ruleset
+                .get(ruleset)
+                .cloned()
+                .unwrap_or(Duration::default())
+                .as_secs_f64();
+            writeln!(
+                f,
+                "Ruleset {ruleset}: search {search_time:.3}s, apply {apply_time:.3}s, rebuild {rebuild_time:.3}s",
+            )?;
+        }
+
+        Ok(())
+    }
+}
+
+/// A report of the results of an extract action.
+#[derive(Debug, Clone)]
+pub enum ExtractReport {
+    Best {
+        termdag: TermDag,
+        cost: usize,
+        term: Term,
+    },
+    Variants {
+        termdag: TermDag,
+        terms: Vec<Term>,
+    },
+}
+
+impl RunReport {
+    fn union_times(
+        times: &HashMap<Symbol, Duration>,
+        other_times: &HashMap<Symbol, Duration>,
+    ) -> HashMap<Symbol, Duration> {
+        let mut new_times = times.clone();
+        for (k, v) in other_times {
+            let entry = new_times.entry(*k).or_default();
+            *entry += *v;
+        }
+        new_times
+    }
+
+    fn union_counts(
+        counts: &HashMap<Symbol, usize>,
+        other_counts: &HashMap<Symbol, usize>,
+    ) -> HashMap<Symbol, usize> {
+        let mut new_counts = counts.clone();
+        for (k, v) in other_counts {
+            let entry = new_counts.entry(*k).or_default();
+            *entry += *v;
+        }
+        new_counts
+    }
+
+    pub fn union(&self, other: &Self) -> Self {
+        Self {
+            updated: self.updated || other.updated,
+            search_time_per_rule: Self::union_times(
+                &self.search_time_per_rule,
+                &other.search_time_per_rule,
+            ),
+            apply_time_per_rule: Self::union_times(
+                &self.apply_time_per_rule,
+                &other.apply_time_per_rule,
+            ),
+            num_matches_per_rule: Self::union_counts(
+                &self.num_matches_per_rule,
+                &other.num_matches_per_rule,
+            ),
+            search_time_per_ruleset: Self::union_times(
+                &self.search_time_per_ruleset,
+                &other.search_time_per_ruleset,
+            ),
+            apply_time_per_ruleset: Self::union_times(
+                &self.apply_time_per_ruleset,
+                &other.apply_time_per_ruleset,
+            ),
+            rebuild_time_per_ruleset: Self::union_times(
+                &self.rebuild_time_per_ruleset,
+                &other.rebuild_time_per_ruleset,
+            ),
+        }
+    }
+}
+
+#[derive(Clone)]
+pub struct Primitive(Arc<dyn PrimitiveLike>);
+impl Primitive {
+    // Takes the full signature of a primitive (including input and output types)
+    // Returns whether the primitive is compatible with this signature
+    fn accept(&self, tys: &[Arc<dyn Sort>], typeinfo: &TypeInfo) -> bool {
+        let mut constraints = vec![];
+        let lits: Vec<_> = (0..tys.len())
+            .map(|i| AtomTerm::Literal(DUMMY_SPAN.clone(), Literal::Int(i as i64)))
+            .collect();
+        for (lit, ty) in lits.iter().zip(tys.iter()) {
+            constraints.push(Constraint::Assign(lit.clone(), ty.clone()))
+        }
+        constraints.extend(self.get_type_constraints(&DUMMY_SPAN).get(&lits, typeinfo));
+        let problem = Problem {
+            constraints,
+            range: HashSet::default(),
+        };
+        problem.solve(|sort| sort.name()).is_ok()
+    }
+}
+
+impl Deref for Primitive {
+    type Target = dyn PrimitiveLike;
+    fn deref(&self) -> &Self::Target {
+        &*self.0
+    }
+}
+
+impl Hash for Primitive {
+    fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
+        Arc::as_ptr(&self.0).hash(state);
+    }
+}
+
+impl Eq for Primitive {}
+impl PartialEq for Primitive {
+    fn eq(&self, other: &Self) -> bool {
+        // this is a bit of a hack, but clippy says we don't want to compare the
+        // vtables, just the data pointers
+        std::ptr::eq(
+            Arc::as_ptr(&self.0) as *const u8,
+            Arc::as_ptr(&other.0) as *const u8,
+        )
+    }
+}
+
+impl Debug for Primitive {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(f, "Prim({})", self.0.name())
+    }
+}
+
+impl<T: PrimitiveLike + 'static> From<T> for Primitive {
+    fn from(p: T) -> Self {
+        Self(Arc::new(p))
+    }
+}
+
+pub struct SimplePrimitive {
+    name: Symbol,
+    input: Vec<ArcSort>,
+    output: ArcSort,
+    f: fn(&[Value]) -> Option<Value>,
+}
+
+impl PrimitiveLike for SimplePrimitive {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        let sorts: Vec<_> = self
+            .input
+            .iter()
+            .chain(once(&self.output as &ArcSort))
+            .cloned()
+            .collect();
+        SimpleTypeConstraint::new(self.name(), sorts, span.clone()).into_box()
+    }
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        (self.f)(values)
+    }
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Hash, Copy)]
+pub enum RunMode {
+    Normal,
+    ShowDesugaredEgglog,
+    // TODO: supporting them needs to refactor the way NCommand is organized.
+    // There is no version of NCommand where CoreRule is used in place of Rule.
+    // As a result, we cannot just call to_lower_rule and get a NCommand with lowered CoreRule in it
+    // and print it out.
+    // A refactoring that allows NCommand to contain CoreRule can make this possible.
+    // ShowCore,
+    // ShowResugaredCore,
+}
+impl RunMode {
+    fn show_egglog(&self) -> bool {
+        matches!(self, RunMode::ShowDesugaredEgglog)
+    }
+}
+
+impl Display for RunMode {
+    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
+        // A little bit unintuitive but RunMode is specified as command-line
+        // argument with flag `--show`, so `--show none` means a normal run.
+        match self {
+            RunMode::Normal => write!(f, "none"),
+            RunMode::ShowDesugaredEgglog => write!(f, "desugared-egglog"),
+            // RunMode::ShowCore => write!(f, "core"),
+            // RunMode::ShowResugaredCore => write!(f, "resugared-core"),
+        }
+    }
+}
+
+impl FromStr for RunMode {
+    type Err = String;
+
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        match s {
+            "none" => Ok(RunMode::Normal),
+            "desugared-egglog" => Ok(RunMode::ShowDesugaredEgglog),
+            // "core" => Ok(RunMode::ShowCore),
+            // "resugared-core" => Ok(RunMode::ShowResugaredCore),
+            _ => Err(format!("Unknown run mode: {s}")),
+        }
+    }
+}
+
+#[derive(Clone)]
+pub struct EGraph {
+    symbol_gen: SymbolGen,
+    egraphs: Vec<Self>,
+    unionfind: UnionFind,
+    pub functions: IndexMap<Symbol, Function>,
+    rulesets: IndexMap<Symbol, Ruleset>,
+    rule_last_run_timestamp: HashMap<Symbol, u32>,
+    interactive_mode: bool,
+    timestamp: u32,
+    pub run_mode: RunMode,
+    pub fact_directory: Option<PathBuf>,
+    pub seminaive: bool,
+    type_info: TypeInfo,
+    extract_report: Option<ExtractReport>,
+    /// The run report for the most recent run of a schedule.
+    recent_run_report: Option<RunReport>,
+    /// The run report unioned over all runs so far.
+    overall_run_report: RunReport,
+    msgs: Vec<String>,
+}
+
+impl Default for EGraph {
+    fn default() -> Self {
+        let mut egraph = Self {
+            symbol_gen: SymbolGen::new("$".to_string()),
+            egraphs: vec![],
+            unionfind: Default::default(),
+            functions: Default::default(),
+            rulesets: Default::default(),
+            rule_last_run_timestamp: Default::default(),
+            timestamp: 0,
+            run_mode: RunMode::Normal,
+            interactive_mode: false,
+            fact_directory: None,
+            seminaive: true,
+            extract_report: None,
+            recent_run_report: None,
+            overall_run_report: Default::default(),
+            msgs: Default::default(),
+            type_info: Default::default(),
+        };
+        egraph
+            .rulesets
+            .insert("".into(), Ruleset::Rules("".into(), Default::default()));
+        egraph
+    }
+}
+
+#[derive(Debug, Error)]
+#[error("Not found: {0}")]
+pub struct NotFoundError(String);
+
+/// For each rule, we produce a `SearchResult`
+/// storing data about that rule's matches.
+/// When a rule has no variables, it may still match- in this case
+/// the `did_match` field is used.
+struct SearchResult {
+    all_matches: Vec<Value>,
+    did_match: bool,
+}
+
+impl EGraph {
+    pub fn is_interactive_mode(&self) -> bool {
+        self.interactive_mode
+    }
+
+    pub fn push(&mut self) {
+        self.egraphs.push(self.clone());
+    }
+
+    /// Pop the current egraph off the stack, replacing
+    /// it with the previously pushed egraph.
+    /// It preserves the run report and messages from the popped
+    /// egraph.
+    pub fn pop(&mut self) -> Result<(), Error> {
+        match self.egraphs.pop() {
+            Some(e) => {
+                // Copy the reports and messages from the popped egraph
+                let extract_report = self.extract_report.clone();
+                let recent_run_report = self.recent_run_report.clone();
+                let overall_run_report = self.overall_run_report.clone();
+                let messages = self.msgs.clone();
+
+                *self = e;
+                self.extract_report = extract_report.or(self.extract_report.clone());
+                // We union the run reports, meaning
+                // that statistics are shared across
+                // push/pop
+                self.recent_run_report = recent_run_report.or(self.recent_run_report.clone());
+                self.overall_run_report = overall_run_report;
+                self.msgs = messages;
+                Ok(())
+            }
+            None => Err(Error::Pop(DUMMY_SPAN.clone())),
+        }
+    }
+
+    pub fn union(&mut self, id1: Id, id2: Id, sort: Symbol) -> Id {
+        self.unionfind.union(id1, id2, sort)
+    }
+
+    #[track_caller]
+    fn debug_assert_invariants(&self) {
+        #[cfg(debug_assertions)]
+        for (name, function) in self.functions.iter() {
+            function.nodes.assert_sorted();
+            for (i, inputs, output) in function.nodes.iter_range(0..function.nodes.len(), true) {
+                assert_eq!(inputs.len(), function.schema.input.len());
+                for (input, sort) in inputs.iter().zip(&function.schema.input) {
+                    assert_eq!(
+                        input,
+                        &self.find(sort, *input),
+                        "[{i}] {name}({inputs:?}) = {output:?}\n{:?}",
+                        function.schema,
+                    )
+                }
+                assert_eq!(
+                    output.value,
+                    self.find(&function.schema.output, output.value),
+                    "[{i}] {name}({inputs:?}) = {output:?}\n{:?}",
+                    function.schema,
+                )
+            }
+            for ix in &function.indexes {
+                for (_, offs) in ix.iter() {
+                    for off in offs {
+                        assert!(
+                            (*off as usize) < function.nodes.num_offsets(),
+                            "index contains offset {off:?}, which is out of range for function {name}"
+                        );
+                    }
+                }
+            }
+            for (rix, sort) in function.rebuild_indexes.iter().zip(
+                function
+                    .schema
+                    .input
+                    .iter()
+                    .chain(once(&function.schema.output)),
+            ) {
+                assert!(sort.is_eq_container_sort() == rix.is_some());
+                if sort.is_eq_container_sort() {
+                    let rix = rix.as_ref().unwrap();
+                    for ix in rix.iter() {
+                        for (_, offs) in ix.iter() {
+                            for off in offs {
+                                assert!(
+                                (*off as usize) < function.nodes.num_offsets(),
+                                "index contains offset {off:?}, which is out of range for function {name}"
+                            );
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    /// find the leader value for a particular eclass
+    pub fn find(&self, sort: &ArcSort, value: Value) -> Value {
+        if sort.is_eq_sort() {
+            Value {
+                #[cfg(debug_assertions)]
+                tag: value.tag,
+                bits: self.unionfind.find(value.bits),
+            }
+        } else {
+            value
+        }
+    }
+
+    pub fn rebuild_nofail(&mut self) -> usize {
+        match self.rebuild() {
+            Ok(updates) => updates,
+            Err(e) => {
+                panic!("Unsoundness detected during rebuild. Exiting: {e}")
+            }
+        }
+    }
+
+    pub fn rebuild(&mut self) -> Result<usize, Error> {
+        self.unionfind.clear_recent_ids();
+
+        let mut updates = 0;
+        loop {
+            let new = self.rebuild_one()?;
+            log::debug!("{new} rebuilds?");
+            self.unionfind.clear_recent_ids();
+            updates += new;
+            if new == 0 {
+                break;
+            }
+        }
+
+        self.debug_assert_invariants();
+        Ok(updates)
+    }
+
+    fn rebuild_one(&mut self) -> Result<usize, Error> {
+        let mut new_unions = 0;
+        let mut deferred_merges = Vec::new();
+        for function in self.functions.values_mut() {
+            let (unions, merges) = function.rebuild(&mut self.unionfind, self.timestamp)?;
+            if !merges.is_empty() {
+                deferred_merges.push((function.decl.name, merges));
+            }
+            new_unions += unions;
+        }
+        for (func, merges) in deferred_merges {
+            new_unions += self.apply_merges(func, &merges);
+        }
+
+        Ok(new_unions)
+    }
+
+    fn apply_merges(&mut self, func: Symbol, merges: &[DeferredMerge]) -> usize {
+        let mut stack = Vec::new();
+        let mut function = self.functions.get_mut(&func).unwrap();
+        let n_unions = self.unionfind.n_unions();
+        let merge_prog = match &function.merge.merge_vals {
+            MergeFn::Expr(e) => Some(e.clone()),
+            MergeFn::AssertEq | MergeFn::Union => None,
+        };
+
+        for (inputs, old, new) in merges {
+            if let Some(prog) = function.merge.on_merge.clone() {
+                self.run_actions(&mut stack, &[*old, *new], &prog).unwrap();
+                function = self.functions.get_mut(&func).unwrap();
+                stack.clear();
+            }
+            if let Some(prog) = &merge_prog {
+                // TODO: error handling?
+                self.run_actions(&mut stack, &[*old, *new], prog).unwrap();
+                let merged = stack.pop().expect("merges should produce a value");
+                stack.clear();
+                function = self.functions.get_mut(&func).unwrap();
+                function.insert(inputs, merged, self.timestamp);
+            }
+        }
+        self.unionfind.n_unions() - n_unions + function.clear_updates()
+    }
+
+    fn declare_function(&mut self, decl: &ResolvedFunctionDecl) -> Result<(), Error> {
+        let function = Function::new(self, decl)?;
+        let old = self.functions.insert(decl.name, function);
+        if old.is_some() {
+            panic!(
+                "Typechecking should have caught function already bound: {}",
+                decl.name
+            );
+        }
+
+        Ok(())
+    }
+
+    pub fn eval_lit(&self, lit: &Literal) -> Value {
+        match lit {
+            Literal::Int(i) => i.store(&I64Sort).unwrap(),
+            Literal::F64(f) => f.store(&F64Sort).unwrap(),
+            Literal::String(s) => s.store(&StringSort).unwrap(),
+            Literal::Unit => ().store(&UnitSort).unwrap(),
+            Literal::Bool(b) => b.store(&BoolSort).unwrap(),
+        }
+    }
+
+    pub fn function_to_dag(
+        &mut self,
+        sym: Symbol,
+        n: usize,
+    ) -> Result<(Vec<(Term, Term)>, TermDag), Error> {
+        let f = self
+            .functions
+            .get(&sym)
+            .ok_or(TypeError::UnboundFunction(sym, DUMMY_SPAN.clone()))?;
+        let schema = f.schema.clone();
+        let nodes = f
+            .nodes
+            .iter(true)
+            .take(n)
+            .map(|(k, v)| (ValueVec::from(k), v.clone()))
+            .collect::<Vec<_>>();
+
+        let mut termdag = TermDag::default();
+        let extractor = Extractor::new(self, &mut termdag);
+        let mut terms = Vec::new();
+        for (ins, out) in nodes {
+            let mut children = Vec::new();
+            for (a, a_type) in ins.iter().copied().zip(&schema.input) {
+                if a_type.is_eq_sort() {
+                    children.push(extractor.find_best(a, &mut termdag, a_type).unwrap().1);
+                } else {
+                    children.push(termdag.expr_to_term(&a_type.make_expr(self, a).1));
+                };
+            }
+
+            let out = if schema.output.is_eq_sort() {
+                extractor
+                    .find_best(out.value, &mut termdag, &schema.output)
+                    .unwrap()
+                    .1
+            } else {
+                termdag.expr_to_term(&schema.output.make_expr(self, out.value).1)
+            };
+            terms.push((termdag.app(sym, children), out));
+        }
+        drop(extractor);
+
+        Ok((terms, termdag))
+    }
+
+    pub fn print_function(&mut self, sym: Symbol, n: usize) -> Result<(), Error> {
+        log::info!("Printing up to {n} tuples of table {sym}: ");
+        let (terms_with_outputs, termdag) = self.function_to_dag(sym, n)?;
+        let f = self
+            .functions
+            .get(&sym)
+            // function_to_dag should have checked this
+            .unwrap();
+        let out_is_unit = f.schema.output.name() == UnitSort.name();
+
+        let mut buf = String::new();
+        let s = &mut buf;
+        s.push_str("(\n");
+        if terms_with_outputs.is_empty() {
+            log::info!("   (none)");
+        }
+        for (term, output) in terms_with_outputs {
+            let tuple_str = format!(
+                "   {}{}",
+                termdag.to_string(&term),
+                if !out_is_unit {
+                    format!(" -> {}", termdag.to_string(&output))
+                } else {
+                    "".into()
+                },
+            );
+            log::info!("{}", tuple_str);
+            s.push_str(&tuple_str);
+            s.push('\n');
+        }
+        s.push_str(")\n");
+        self.print_msg(buf);
+        Ok(())
+    }
+
+    pub fn print_size(&mut self, sym: Option<Symbol>) -> Result<(), Error> {
+        if let Some(sym) = sym {
+            let f = self
+                .functions
+                .get(&sym)
+                .ok_or(TypeError::UnboundFunction(sym, DUMMY_SPAN.clone()))?;
+            log::info!("Function {} has size {}", sym, f.nodes.len());
+            self.print_msg(f.nodes.len().to_string());
+            Ok(())
+        } else {
+            // Print size of all functions
+            let mut lens = self
+                .functions
+                .iter()
+                .map(|(sym, f)| (*sym, f.nodes.len()))
+                .collect::<Vec<_>>();
+
+            // Function name's alphabetical order
+            lens.sort_by_key(|(name, _)| name.as_str());
+
+            for (sym, len) in &lens {
+                log::info!("Function {} has size {}", sym, len);
+            }
+
+            self.print_msg(
+                lens.into_iter()
+                    .map(|(name, len)| format!("{}: {}", name, len))
+                    .collect::<Vec<_>>()
+                    .join("\n"),
+            );
+
+            Ok(())
+        }
+    }
+
+    // returns whether the egraph was updated
+    fn run_schedule(&mut self, sched: &ResolvedSchedule) -> RunReport {
+        match sched {
+            ResolvedSchedule::Run(span, config) => self.run_rules(span, config),
+            ResolvedSchedule::Repeat(_span, limit, sched) => {
+                let mut report = RunReport::default();
+                for _i in 0..*limit {
+                    let rec = self.run_schedule(sched);
+                    report = report.union(&rec);
+                    if !rec.updated {
+                        break;
+                    }
+                }
+                report
+            }
+            ResolvedSchedule::Saturate(_span, sched) => {
+                let mut report = RunReport::default();
+                loop {
+                    let rec = self.run_schedule(sched);
+                    report = report.union(&rec);
+                    if !rec.updated {
+                        break;
+                    }
+                }
+                report
+            }
+            ResolvedSchedule::Sequence(_span, scheds) => {
+                let mut report = RunReport::default();
+                for sched in scheds {
+                    report = report.union(&self.run_schedule(sched));
+                }
+                report
+            }
+        }
+    }
+
+    /// Extract a value to a [`TermDag`] and [`Term`] in the [`TermDag`].
+    /// Note that the `TermDag` may contain a superset of the nodes in the `Term`.
+    /// See also `extract_value_to_string` for convenience.
+    pub fn extract_value(&self, sort: &ArcSort, value: Value) -> (TermDag, Term) {
+        let mut termdag = TermDag::default();
+        let term = self.extract(value, &mut termdag, sort).1;
+        (termdag, term)
+    }
+
+    /// Extract a value to a string for printing.
+    /// See also `extract_value` for more control.
+    pub fn extract_value_to_string(&self, sort: &ArcSort, value: Value) -> String {
+        let (termdag, term) = self.extract_value(sort, value);
+        termdag.to_string(&term)
+    }
+
+    fn run_rules(&mut self, span: &Span, config: &ResolvedRunConfig) -> RunReport {
+        let mut report: RunReport = Default::default();
+
+        // first rebuild
+        let rebuild_start = Instant::now();
+        let updates = self.rebuild_nofail();
+        log::debug!("database size: {}", self.num_tuples());
+        log::debug!("Made {updates} updates");
+        // add to the rebuild time for this ruleset
+        report.add_ruleset_rebuild_time(config.ruleset, rebuild_start.elapsed());
+        self.timestamp += 1;
+
+        let GenericRunConfig { ruleset, until } = config;
+
+        if let Some(facts) = until {
+            if self.check_facts(span, facts).is_ok() {
+                log::info!(
+                    "Breaking early because of facts:\n {}!",
+                    ListDisplay(facts, "\n")
+                );
+                return report;
+            }
+        }
+
+        let subreport = self.step_rules(*ruleset);
+        report = report.union(&subreport);
+
+        log::debug!("database size: {}", self.num_tuples());
+        self.timestamp += 1;
+
+        report
+    }
+
+    /// Search all the rules in a ruleset.
+    /// Add the search results for a rule to search_results, a map indexed by rule name.
+    fn search_rules(
+        &self,
+        ruleset: Symbol,
+        run_report: &mut RunReport,
+        search_results: &mut HashMap<Symbol, SearchResult>,
+    ) {
+        let rules = self
+            .rulesets
+            .get(&ruleset)
+            .unwrap_or_else(|| panic!("ruleset does not exist: {}", &ruleset));
+        match rules {
+            Ruleset::Rules(_ruleset_name, rule_names) => {
+                let copy_rules = rule_names.clone();
+                let search_start = Instant::now();
+
+                for (rule_name, rule) in copy_rules.iter() {
+                    let mut all_matches = vec![];
+                    let rule_search_start = Instant::now();
+                    let mut did_match = false;
+                    let timestamp = self.rule_last_run_timestamp.get(rule_name).unwrap_or(&0);
+                    self.run_query(&rule.query, *timestamp, false, |values| {
+                        did_match = true;
+                        assert_eq!(values.len(), rule.query.vars.len());
+                        all_matches.extend_from_slice(values);
+                        Ok(())
+                    });
+                    let rule_search_time = rule_search_start.elapsed();
+                    log::trace!(
+                        "Searched for {rule_name} in {:.3}s ({} results)",
+                        rule_search_time.as_secs_f64(),
+                        all_matches.len()
+                    );
+                    run_report.add_rule_search_time(*rule_name, rule_search_time);
+                    search_results.insert(
+                        *rule_name,
+                        SearchResult {
+                            all_matches,
+                            did_match,
+                        },
+                    );
+                }
+
+                let search_time = search_start.elapsed();
+                run_report.add_ruleset_search_time(ruleset, search_time);
+            }
+            Ruleset::Combined(_name, sub_rulesets) => {
+                let start_time = Instant::now();
+                for sub_ruleset in sub_rulesets {
+                    self.search_rules(*sub_ruleset, run_report, search_results);
+                }
+                let search_time = start_time.elapsed();
+                run_report.add_ruleset_search_time(ruleset, search_time);
+            }
+        }
+    }
+
+    fn apply_rules(
+        &mut self,
+        ruleset: Symbol,
+        run_report: &mut RunReport,
+        search_results: &HashMap<Symbol, SearchResult>,
+    ) {
+        // TODO this clone is not efficient
+        let rules = self.rulesets.get(&ruleset).unwrap().clone();
+        match rules {
+            Ruleset::Rules(_name, compiled_rules) => {
+                let apply_start = Instant::now();
+                let rule_names = compiled_rules.keys().cloned().collect::<Vec<_>>();
+                for rule_name in rule_names {
+                    let SearchResult {
+                        all_matches,
+                        did_match,
+                    } = search_results.get(&rule_name).unwrap();
+                    let rule = compiled_rules.get(&rule_name).unwrap();
+                    let num_vars = rule.query.vars.len();
+
+                    // make sure the query requires matches
+                    if num_vars != 0 {
+                        run_report.add_rule_num_matches(rule_name, all_matches.len() / num_vars);
+                    }
+
+                    self.rule_last_run_timestamp
+                        .insert(rule_name, self.timestamp);
+                    let rule_apply_start = Instant::now();
+
+                    let stack = &mut vec![];
+
+                    // when there are no variables, a query can still fail to match
+                    // here we handle that case
+                    if num_vars == 0 {
+                        if *did_match {
+                            stack.clear();
+                            self.run_actions(stack, &[], &rule.program)
+                                .unwrap_or_else(|e| {
+                                    panic!("error while running actions for {rule_name}: {e}")
+                                });
+                        }
+                    } else {
+                        for values in all_matches.chunks(num_vars) {
+                            stack.clear();
+                            self.run_actions(stack, values, &rule.program)
+                                .unwrap_or_else(|e| {
+                                    panic!("error while running actions for {rule_name}: {e}")
+                                });
+                        }
+                    }
+
+                    // add to the rule's apply time
+                    run_report.add_rule_apply_time(rule_name, rule_apply_start.elapsed());
+                }
+                run_report.add_ruleset_apply_time(ruleset, apply_start.elapsed());
+            }
+            Ruleset::Combined(_name, sub_rulesets) => {
+                let start_time = Instant::now();
+                for sub_ruleset in sub_rulesets {
+                    self.apply_rules(sub_ruleset, run_report, search_results);
+                }
+                let apply_time = start_time.elapsed();
+                run_report.add_ruleset_apply_time(ruleset, apply_time);
+            }
+        }
+    }
+
+    fn step_rules(&mut self, ruleset: Symbol) -> RunReport {
+        let n_unions_before = self.unionfind.n_unions();
+        let mut run_report = Default::default();
+        let mut search_results = HashMap::<Symbol, SearchResult>::default();
+        self.search_rules(ruleset, &mut run_report, &mut search_results);
+        self.apply_rules(ruleset, &mut run_report, &search_results);
+        run_report.updated |=
+            self.did_change_tables() || n_unions_before != self.unionfind.n_unions();
+
+        run_report
+    }
+
+    fn did_change_tables(&self) -> bool {
+        for (_name, function) in &self.functions {
+            if function.nodes.max_ts() >= self.timestamp {
+                return true;
+            }
+        }
+
+        false
+    }
+
+    fn add_rule_with_name(
+        &mut self,
+        name: String,
+        rule: ast::ResolvedRule,
+        ruleset: Symbol,
+    ) -> Result<Symbol, Error> {
+        let name = Symbol::from(name);
+        let core_rule = rule.to_canonicalized_core_rule(&self.type_info, &mut self.symbol_gen)?;
+        let (query, actions) = (core_rule.body, core_rule.head);
+
+        let vars = query.get_vars();
+        let query = self.compile_gj_query(query, &vars);
+
+        let program = self
+            .compile_actions(&vars, &actions)
+            .map_err(Error::TypeErrors)?;
+        let compiled_rule = CompiledRule { query, program };
+        if let Some(rules) = self.rulesets.get_mut(&ruleset) {
+            match rules {
+                Ruleset::Rules(_, rules) => {
+                    match rules.entry(name) {
+                        indexmap::map::Entry::Occupied(_) => {
+                            panic!("Rule '{name}' was already present")
+                        }
+                        indexmap::map::Entry::Vacant(e) => e.insert(compiled_rule),
+                    };
+                    Ok(name)
+                }
+                Ruleset::Combined(_, _) => Err(Error::CombinedRulesetError(ruleset, rule.span)),
+            }
+        } else {
+            Err(Error::NoSuchRuleset(ruleset, rule.span))
+        }
+    }
+
+    pub(crate) fn add_rule(
+        &mut self,
+        rule: ast::ResolvedRule,
+        ruleset: Symbol,
+    ) -> Result<Symbol, Error> {
+        let name = format!("{}", rule);
+        self.add_rule_with_name(name, rule, ruleset)
+    }
+
+    fn eval_actions(&mut self, actions: &ResolvedActions) -> Result<(), Error> {
+        let (actions, _) = actions.to_core_actions(
+            &self.type_info,
+            &mut Default::default(),
+            &mut self.symbol_gen,
+        )?;
+        let program = self
+            .compile_actions(&Default::default(), &actions)
+            .map_err(Error::TypeErrors)?;
+        let mut stack = vec![];
+        self.run_actions(&mut stack, &[], &program)?;
+        Ok(())
+    }
+
+    pub fn eval_expr(&mut self, expr: &Expr) -> Result<(ArcSort, Value), Error> {
+        let fresh_name = self.symbol_gen.fresh(&"egraph_evalexpr".into());
+        let command = Command::Action(Action::Let(DUMMY_SPAN.clone(), fresh_name, expr.clone()));
+        self.run_program(vec![command])?;
+        // find the table with the same name as the fresh name
+        let func = self.functions.get(&fresh_name).unwrap();
+        let value = func.nodes.get(&[]).unwrap().value;
+        let sort = func.schema.output.clone();
+        Ok((sort, value))
+    }
+
+    // TODO make a public version of eval_expr that makes a command,
+    // then returns the value at the end.
+    fn eval_resolved_expr(&mut self, expr: &ResolvedExpr) -> Result<Value, Error> {
+        let (actions, mapped_expr) = expr.to_core_actions(
+            &self.type_info,
+            &mut Default::default(),
+            &mut self.symbol_gen,
+        )?;
+        let target = mapped_expr.get_corresponding_var_or_lit(&self.type_info);
+        let program = self
+            .compile_expr(&Default::default(), &actions, &target)
+            .map_err(Error::TypeErrors)?;
+        let mut stack = vec![];
+        self.run_actions(&mut stack, &[], &program)?;
+        Ok(stack.pop().unwrap())
+    }
+
+    fn add_combined_ruleset(&mut self, name: Symbol, rulesets: Vec<Symbol>) {
+        match self.rulesets.entry(name) {
+            Entry::Occupied(_) => panic!("Ruleset '{name}' was already present"),
+            Entry::Vacant(e) => e.insert(Ruleset::Combined(name, rulesets)),
+        };
+    }
+
+    fn add_ruleset(&mut self, name: Symbol) {
+        match self.rulesets.entry(name) {
+            Entry::Occupied(_) => panic!("Ruleset '{name}' was already present"),
+            Entry::Vacant(e) => e.insert(Ruleset::Rules(name, Default::default())),
+        };
+    }
+
+    fn set_option(&mut self, name: &str, value: ResolvedExpr) {
+        match name {
+            "interactive_mode" => {
+                if let ResolvedExpr::Lit(_ann, Literal::Int(i)) = value {
+                    self.interactive_mode = i != 0;
+                } else {
+                    panic!("interactive_mode must be an integer");
+                }
+            }
+            _ => panic!("Unknown option '{}'", name),
+        }
+    }
+
+    fn check_facts(&mut self, span: &Span, facts: &[ResolvedFact]) -> Result<(), Error> {
+        let rule = ast::ResolvedRule {
+            span: span.clone(),
+            head: ResolvedActions::default(),
+            body: facts.to_vec(),
+        };
+        let core_rule = rule.to_canonicalized_core_rule(&self.type_info, &mut self.symbol_gen)?;
+        let query = core_rule.body;
+        let ordering = &query.get_vars();
+        let query = self.compile_gj_query(query, ordering);
+
+        let mut matched = false;
+        self.run_query(&query, 0, true, |values| {
+            assert_eq!(values.len(), query.vars.len());
+            matched = true;
+            Err(())
+        });
+        if !matched {
+            Err(Error::CheckError(
+                facts.iter().map(|f| f.clone().make_unresolved()).collect(),
+                span.clone(),
+            ))
+        } else {
+            Ok(())
+        }
+    }
+
+    fn run_command(&mut self, command: ResolvedNCommand) -> Result<(), Error> {
+        let pre_rebuild = Instant::now();
+        let rebuild_num = self.rebuild()?;
+        if rebuild_num > 0 {
+            log::info!(
+                "Rebuild before command: {:10}ms",
+                pre_rebuild.elapsed().as_millis()
+            );
+        }
+
+        self.debug_assert_invariants();
+
+        match command {
+            ResolvedNCommand::SetOption { name, value } => {
+                let str = format!("Set option {} to {}", name, value);
+                self.set_option(name.into(), value);
+                log::info!("{}", str)
+            }
+            // Sorts are already declared during typechecking
+            ResolvedNCommand::Sort(_span, name, _presort_and_args) => {
+                log::info!("Declared sort {}.", name)
+            }
+            ResolvedNCommand::Function(fdecl) => {
+                self.declare_function(&fdecl)?;
+                log::info!("Declared function {}.", fdecl.name)
+            }
+            ResolvedNCommand::AddRuleset(name) => {
+                self.add_ruleset(name);
+                log::info!("Declared ruleset {name}.");
+            }
+            ResolvedNCommand::UnstableCombinedRuleset(name, others) => {
+                self.add_combined_ruleset(name, others);
+                log::info!("Declared ruleset {name}.");
+            }
+            ResolvedNCommand::NormRule {
+                ruleset,
+                rule,
+                name,
+            } => {
+                self.add_rule(rule, ruleset)?;
+                log::info!("Declared rule {name}.")
+            }
+            ResolvedNCommand::RunSchedule(sched) => {
+                let report = self.run_schedule(&sched);
+                log::info!("Ran schedule {}.", sched);
+                log::info!("Report: {}", report);
+                self.overall_run_report = self.overall_run_report.union(&report);
+                self.recent_run_report = Some(report);
+            }
+            ResolvedNCommand::PrintOverallStatistics => {
+                log::info!("Overall statistics:\n{}", self.overall_run_report);
+                self.print_msg(format!("Overall statistics:\n{}", self.overall_run_report));
+            }
+            ResolvedNCommand::Check(span, facts) => {
+                self.check_facts(&span, &facts)?;
+                log::info!("Checked fact {:?}.", facts);
+            }
+            ResolvedNCommand::CoreAction(action) => match &action {
+                ResolvedAction::Let(_, name, contents) => {
+                    panic!("Globals should have been desugared away: {name} = {contents}")
+                }
+                _ => {
+                    self.eval_actions(&ResolvedActions::new(vec![action.clone()]))?;
+                }
+            },
+            ResolvedNCommand::Push(n) => {
+                (0..n).for_each(|_| self.push());
+                log::info!("Pushed {n} levels.")
+            }
+            ResolvedNCommand::Pop(span, n) => {
+                for _ in 0..n {
+                    self.pop().map_err(|err| {
+                        if let Error::Pop(_) = err {
+                            Error::Pop(span.clone())
+                        } else {
+                            err
+                        }
+                    })?;
+                }
+                log::info!("Popped {n} levels.")
+            }
+            ResolvedNCommand::PrintTable(span, f, n) => {
+                self.print_function(f, n).map_err(|e| match e {
+                    Error::TypeError(TypeError::UnboundFunction(f, _)) => {
+                        Error::TypeError(TypeError::UnboundFunction(f, span.clone()))
+                    }
+                    // This case is currently impossible
+                    _ => e,
+                })?;
+            }
+            ResolvedNCommand::PrintSize(span, f) => {
+                self.print_size(f).map_err(|e| match e {
+                    Error::TypeError(TypeError::UnboundFunction(f, _)) => {
+                        Error::TypeError(TypeError::UnboundFunction(f, span.clone()))
+                    }
+                    // This case is currently impossible
+                    _ => e,
+                })?;
+            }
+            ResolvedNCommand::Fail(span, c) => {
+                let result = self.run_command(*c);
+                if let Err(e) = result {
+                    log::info!("Command failed as expected: {e}");
+                } else {
+                    return Err(Error::ExpectFail(span));
+                }
+            }
+            ResolvedNCommand::Input {
+                span: _,
+                name,
+                file,
+            } => {
+                self.input_file(name, file)?;
+            }
+            ResolvedNCommand::Output { span, file, exprs } => {
+                let mut filename = self.fact_directory.clone().unwrap_or_default();
+                filename.push(file.as_str());
+                // append to file
+                let mut f = File::options()
+                    .append(true)
+                    .create(true)
+                    .open(&filename)
+                    .map_err(|e| Error::IoError(filename.clone(), e, span.clone()))?;
+                let mut termdag = TermDag::default();
+                for expr in exprs {
+                    let value = self.eval_resolved_expr(&expr)?;
+                    let expr_type = expr.output_type();
+                    let term = self.extract(value, &mut termdag, &expr_type).1;
+                    use std::io::Write;
+                    writeln!(f, "{}", termdag.to_string(&term))
+                        .map_err(|e| Error::IoError(filename.clone(), e, span.clone()))?;
+                }
+
+                log::info!("Output to '{filename:?}'.")
+            }
+        };
+        Ok(())
+    }
+
+    fn input_file(&mut self, func_name: Symbol, file: String) -> Result<(), Error> {
+        let function_type = self
+            .type_info
+            .lookup_user_func(func_name)
+            .unwrap_or_else(|| panic!("Unrecognized function name {}", func_name));
+        let func = self.functions.get_mut(&func_name).unwrap();
+
+        let mut filename = self.fact_directory.clone().unwrap_or_default();
+        filename.push(file.as_str());
+
+        // check that the function uses supported types
+
+        for t in &func.schema.input {
+            match t.name().as_str() {
+                "i64" | "f64" | "String" => {}
+                s => panic!("Unsupported type {} for input", s),
+            }
+        }
+
+        if !function_type.is_datatype {
+            match func.schema.output.name().as_str() {
+                "i64" | "String" | "Unit" => {}
+                s => panic!("Unsupported type {} for input", s),
+            }
+        }
+
+        log::info!("Opening file '{:?}'...", filename);
+        let mut f = File::open(filename).unwrap();
+        let mut contents = String::new();
+        f.read_to_string(&mut contents).unwrap();
+
+        let span: Span = DUMMY_SPAN.clone();
+        let mut actions: Vec<Action> = vec![];
+        let mut str_buf: Vec<&str> = vec![];
+        for line in contents.lines() {
+            str_buf.clear();
+            str_buf.extend(line.split('\t').map(|s| s.trim()));
+            if str_buf.is_empty() {
+                continue;
+            }
+
+            let parse = |s: &str| -> Expr {
+                match s.parse::<i64>() {
+                    Ok(i) => Expr::Lit(span.clone(), Literal::Int(i)),
+                    Err(_) => match s.parse::<f64>() {
+                        Ok(f) => Expr::Lit(span.clone(), Literal::F64(f.into())),
+                        Err(_) => Expr::Lit(span.clone(), Literal::String(s.into())),
+                    },
+                }
+            };
+
+            let mut exprs: Vec<Expr> = str_buf.iter().map(|&s| parse(s)).collect();
+
+            actions.push(
+                if function_type.is_datatype || function_type.output.name() == UnitSort.name() {
+                    Action::Expr(span.clone(), Expr::Call(span.clone(), func_name, exprs))
+                } else {
+                    let out = exprs.pop().unwrap();
+                    Action::Set(span.clone(), func_name, exprs, out)
+                },
+            );
+        }
+        let num_facts = actions.len();
+        let commands = actions
+            .into_iter()
+            .map(NCommand::CoreAction)
+            .collect::<Vec<_>>();
+        let commands: Vec<_> = self
+            .type_info
+            .typecheck_program(&mut self.symbol_gen, &commands)?;
+        for command in commands {
+            self.run_command(command)?;
+        }
+        log::info!("Read {num_facts} facts into {func_name} from '{file}'.");
+        Ok(())
+    }
+
+    pub fn clear(&mut self) {
+        for f in self.functions.values_mut() {
+            f.clear();
+        }
+    }
+
+    pub fn set_reserved_symbol(&mut self, sym: Symbol) {
+        assert!(
+            !self.symbol_gen.has_been_used(),
+            "Reserved symbol must be set before any symbols are generated"
+        );
+        self.symbol_gen = SymbolGen::new(sym.to_string());
+    }
+
+    fn process_command(&mut self, command: Command) -> Result<Vec<ResolvedNCommand>, Error> {
+        let program =
+            desugar::desugar_program(vec![command], &mut self.symbol_gen, self.seminaive)?;
+
+        let program = self
+            .type_info
+            .typecheck_program(&mut self.symbol_gen, &program)?;
+
+        let program = remove_globals(program, &mut self.symbol_gen);
+
+        Ok(program)
+    }
+
+    /// Run a program, represented as an AST.
+    /// Return a list of messages.
+    pub fn run_program(&mut self, program: Vec<Command>) -> Result<Vec<String>, Error> {
+        for command in program {
+            // Important to process each command individually
+            // because push and pop create new scopes
+            for processed in self.process_command(command)? {
+                if self.run_mode.show_egglog() {
+                    // In show_egglog mode, we still need to run scope-related commands (Push/Pop) to make
+                    // the program well-scoped.
+                    match &processed {
+                        ResolvedNCommand::Push(..) | ResolvedNCommand::Pop(..) => {
+                            self.run_command(processed.clone())?;
+                        }
+                        _ => {}
+                    };
+                    self.print_msg(processed.to_command().to_string());
+                    continue;
+                }
+
+                self.run_command(processed)?;
+            }
+        }
+        log::logger().flush();
+
+        Ok(self.flush_msgs())
+    }
+
+    /// Takes a source program `input`, parses it, runs it, and returns a list of messages.
+    ///
+    /// `filename` is an optional argument to indicate the source of
+    /// the program for error reporting. If `filename` is `None`,
+    /// a default name will be used.
+    pub fn parse_and_run_program(
+        &mut self,
+        filename: Option<String>,
+        input: &str,
+    ) -> Result<Vec<String>, Error> {
+        let parsed = parse_program(filename, input)?;
+        self.run_program(parsed)
+    }
+
+    pub fn num_tuples(&self) -> usize {
+        self.functions.values().map(|f| f.nodes.len()).sum()
+    }
+
+    /// Returns a sort based on the type
+    pub fn get_sort<S: Sort + Send + Sync>(&self) -> Option<Arc<S>> {
+        self.type_info.get_sort_by(|_| true)
+    }
+
+    /// Returns the first sort that satisfies the type and predicate if there's one.
+    /// Otherwise returns none.
+    pub fn get_sort_by<S: Sort + Send + Sync>(
+        &self,
+        pred: impl Fn(&Arc<S>) -> bool,
+    ) -> Option<Arc<S>> {
+        self.type_info.get_sort_by(pred)
+    }
+
+    /// Add a user-defined sort
+    pub fn add_arcsort(&mut self, arcsort: ArcSort) -> Result<(), TypeError> {
+        self.type_info.add_arcsort(arcsort, DUMMY_SPAN.clone())
+    }
+
+    /// Add a user-defined primitive
+    pub fn add_primitive(&mut self, prim: impl Into<Primitive>) {
+        self.type_info.add_primitive(prim)
+    }
+
+    /// Gets the last extract report and returns it, if the last command saved it.
+    pub fn get_extract_report(&self) -> &Option<ExtractReport> {
+        &self.extract_report
+    }
+
+    /// Gets the last run report and returns it, if the last command saved it.
+    pub fn get_run_report(&self) -> &Option<RunReport> {
+        &self.recent_run_report
+    }
+
+    /// Gets the overall run report and returns it.
+    pub fn get_overall_run_report(&self) -> &RunReport {
+        &self.overall_run_report
+    }
+
+    pub(crate) fn print_msg(&mut self, msg: String) {
+        self.msgs.push(msg);
+    }
+
+    fn flush_msgs(&mut self) -> Vec<String> {
+        self.msgs.dedup_by(|a, b| a.is_empty() && b.is_empty());
+        std::mem::take(&mut self.msgs)
+    }
+}
+
+// Currently, only the following errors can thrown without location information:
+// * PrimitiveError
+// * MergeError
+// * SubsumeMergeError
+#[derive(Debug, Error)]
+pub enum Error {
+    #[error(transparent)]
+    ParseError(#[from] ParseError),
+    #[error(transparent)]
+    NotFoundError(#[from] NotFoundError),
+    #[error(transparent)]
+    TypeError(#[from] TypeError),
+    #[error("Errors:\n{}", ListDisplay(.0, "\n"))]
+    TypeErrors(Vec<TypeError>),
+    #[error("{1}\nCheck failed: \n{}", ListDisplay(.0, "\n"))]
+    CheckError(Vec<Fact>, Span),
+    #[error("{1}\nNo such ruleset: {0}")]
+    NoSuchRuleset(Symbol, Span),
+    #[error("{1}\nAttempted to add a rule to combined ruleset {0}. Combined rulesets may only depend on other rulesets.")]
+    CombinedRulesetError(Symbol, Span),
+    #[error("Evaluating primitive {0:?} failed. ({0:?} {:?})", ListDebug(.1, " "))]
+    PrimitiveError(Primitive, Vec<Value>),
+    #[error("Illegal merge attempted for function {0}, {1:?} != {2:?}")]
+    MergeError(Symbol, Value, Value),
+    #[error("{0}\nTried to pop too much")]
+    Pop(Span),
+    #[error("{0}\nCommand should have failed.")]
+    ExpectFail(Span),
+    #[error("{2}\nIO error: {0}: {1}")]
+    IoError(PathBuf, std::io::Error, Span),
+    #[error("Cannot subsume function with merge: {0}")]
+    SubsumeMergeError(Symbol),
+}
+
+#[cfg(test)]
+mod tests {
+    use std::sync::Arc;
+
+    use crate::constraint::SimpleTypeConstraint;
+    use crate::sort::*;
+    use crate::*;
+
+    struct InnerProduct {
+        ele: Arc<I64Sort>,
+        vec: Arc<VecSort>,
+    }
+
+    impl PrimitiveLike for InnerProduct {
+        fn name(&self) -> symbol_table::GlobalSymbol {
+            "inner-product".into()
+        }
+
+        fn get_type_constraints(&self, span: &Span) -> Box<dyn crate::constraint::TypeConstraint> {
+            SimpleTypeConstraint::new(
+                self.name(),
+                vec![self.vec.clone(), self.vec.clone(), self.ele.clone()],
+                span.clone(),
+            )
+            .into_box()
+        }
+
+        fn apply(
+            &self,
+            values: &[Value],
+            _sorts: (&[ArcSort], &ArcSort),
+            _egraph: Option<&mut EGraph>,
+        ) -> Option<Value> {
+            let mut sum = 0;
+            let vec1 = Vec::<Value>::load(&self.vec, &values[0]);
+            let vec2 = Vec::<Value>::load(&self.vec, &values[1]);
+            assert_eq!(vec1.len(), vec2.len());
+            for (a, b) in vec1.iter().zip(vec2.iter()) {
+                let a = i64::load(&self.ele, a);
+                let b = i64::load(&self.ele, b);
+                sum += a * b;
+            }
+            sum.store(&self.ele)
+        }
+    }
+
+    #[test]
+    fn test_user_defined_primitive() {
+        let mut egraph = EGraph::default();
+        egraph
+            .parse_and_run_program(None, "(sort IntVec (Vec i64))")
+            .unwrap();
+
+        let int_vec_sort: Arc<VecSort> = egraph
+            .get_sort_by(|s: &Arc<VecSort>| s.element_name() == I64Sort.name())
+            .unwrap();
+
+        egraph.add_primitive(InnerProduct {
+            ele: I64Sort.into(),
+            vec: int_vec_sort,
+        });
+
+        egraph
+            .parse_and_run_program(
+                None,
+                "
+                (let a (vec-of 1 2 3 4 5 6))
+                (let b (vec-of 6 5 4 3 2 1))
+                (check (= (inner-product a b) 56))
+            ",
+            )
+            .unwrap();
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/serialize.rs.html b/docs/src/egglog/serialize.rs.html new file mode 100644 index 00000000..3d122eaa --- /dev/null +++ b/docs/src/egglog/serialize.rs.html @@ -0,0 +1,681 @@ +serialize.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+
use ordered_float::NotNan;
+use std::collections::VecDeque;
+
+use crate::{util::HashMap, ArcSort, EGraph, Function, Symbol, TupleOutput, Value};
+
+pub struct SerializeConfig {
+    // Maximumum number of functions to include in the serialized graph, any after this will be discarded
+    pub max_functions: Option<usize>,
+    // Maximum number of calls to include per function, any after this will be discarded
+    pub max_calls_per_function: Option<usize>,
+    // Whether to include temporary functions in the serialized graph
+    pub include_temporary_functions: bool,
+    // Root eclasses to include in the output
+    pub root_eclasses: Vec<(ArcSort, Value)>,
+}
+
+/// Default is used for exporting JSON and will output all nodes.
+impl Default for SerializeConfig {
+    fn default() -> Self {
+        SerializeConfig {
+            max_functions: None,
+            max_calls_per_function: None,
+            include_temporary_functions: false,
+            root_eclasses: vec![],
+        }
+    }
+}
+
+/// A node in the serialized egraph.
+#[derive(PartialEq, Debug, Clone)]
+pub enum SerializedNode {
+    /// A user defined function call.
+    Function {
+        /// The name of the function.
+        name: Symbol,
+        /// The offset of the index in the table.
+        /// This can be resolved to the output and input values with table.get_index(offset, true).
+        offset: usize,
+    },
+    /// A primitive value.
+    Primitive(Value),
+    /// A dummy node used to represent omitted nodes.
+    Dummy(Value),
+    /// A node that was split into multiple e-classes.
+    Split(Box<SerializedNode>),
+}
+
+impl SerializedNode {
+    /// Returns true if the node is a primitive value.
+    pub fn is_primitive(&self) -> bool {
+        match self {
+            SerializedNode::Primitive(_) => true,
+            SerializedNode::Split(node) => node.is_primitive(),
+            _ => false,
+        }
+    }
+}
+
+impl EGraph {
+    /// Serialize the egraph into a format that can be read by the egraph-serialize crate.
+    ///
+    /// There are multiple different semantically valid ways to do this. This is how this implementation does it:
+    ///
+    /// For node costs:
+    /// - Primitives: 1.0
+    /// - Function without costs: 1.0
+    /// - Function with costs: the cost
+    /// - Omitted nodes: infinite
+    ///
+    /// For node IDs:
+    /// - Functions: Function name + hash of input values
+    /// - Args which are eq sorts: Choose one ID from the e-class, distribute roughly evenly.
+    /// - Args and outputs values which are primitives: Sort name + hash of value
+    ///
+    /// For e-classes IDs:
+    /// - tag and value of canonicalized value
+    ///
+    /// This is to achieve the following properties:
+    /// - Equivalent primitive values will show up once in the e-graph.
+    /// - Functions which return primitive values will be added to the e-class of that value.
+    /// - Nodes will have consistant IDs throughout execution of e-graph (used for animating changes in the visualization)
+    /// - Edges in the visualization will be well distributed (used for animating changes in the visualization)
+    ///   (Note that this will be changed in `<https://github.com/egraphs-good/egglog/pull/158>` so that edges point to exact nodes instead of looking up the e-class)
+    pub fn serialize(&self, config: SerializeConfig) -> egraph_serialize::EGraph {
+        // First collect a list of all the calls we want to serialize as (function decl, inputs, the output, the node id)
+        let all_calls: Vec<(
+            &Function,
+            &[Value],
+            &TupleOutput,
+            egraph_serialize::ClassId,
+            egraph_serialize::NodeId,
+        )> = self
+            .functions
+            .iter()
+            .filter(|(_, function)| !function.decl.ignore_viz)
+            .map(|(name, function)| {
+                function
+                    .nodes
+                    .iter_range(0..function.nodes.num_offsets(), true)
+                    .take(config.max_calls_per_function.unwrap_or(usize::MAX))
+                    .map(|(offset, input, output)| {
+                        (
+                            function,
+                            input,
+                            output,
+                            self.value_to_class_id(&function.schema.output, &output.value),
+                            self.to_node_id(
+                                None,
+                                SerializedNode::Function {
+                                    name: *name,
+                                    offset,
+                                },
+                            ),
+                        )
+                    })
+                    .collect::<Vec<_>>()
+            })
+            // Filter out functions with no calls
+            .filter(|f| !f.is_empty())
+            .take(config.max_functions.unwrap_or(usize::MAX))
+            .flatten()
+            .collect();
+
+        // Then create a mapping from each canonical e-class ID to the set of node IDs in that e-class
+        // Note that this is only for e-classes, primitives have e-classes equal to their node ID
+        // This is for when we need to find what node ID to use for an edge to an e-class, we can rotate them evenly
+        // amoung all possible options.
+        let mut node_ids: NodeIDs = all_calls.iter().fold(
+            HashMap::default(),
+            |mut acc, (func, _input, _output, class_id, node_id)| {
+                if func.schema.output.is_eq_sort() {
+                    acc.entry(class_id.clone())
+                        .or_default()
+                        .push_back(node_id.clone());
+                }
+                acc
+            },
+        );
+
+        let mut egraph = egraph_serialize::EGraph::default();
+        for (func, input, output, class_id, node_id) in all_calls {
+            self.serialize_value(
+                &mut egraph,
+                &mut node_ids,
+                &func.schema.output,
+                &output.value,
+                &class_id,
+            );
+
+            assert_eq!(input.len(), func.schema.input.len());
+            let children: Vec<_> = input
+                .iter()
+                .zip(&func.schema.input)
+                .map(|(v, sort)| {
+                    self.serialize_value(
+                        &mut egraph,
+                        &mut node_ids,
+                        sort,
+                        v,
+                        &self.value_to_class_id(sort, v),
+                    )
+                })
+                .collect();
+            egraph.nodes.insert(
+                node_id,
+                egraph_serialize::Node {
+                    op: func.decl.name.to_string(),
+                    eclass: class_id.clone(),
+                    cost: NotNan::new(func.decl.cost.unwrap_or(1) as f64).unwrap(),
+                    children,
+                    subsumed: output.subsumed,
+                },
+            );
+        }
+
+        egraph.root_eclasses = config
+            .root_eclasses
+            .iter()
+            .map(|(sort, v)| self.value_to_class_id(sort, v))
+            .collect();
+
+        egraph
+    }
+
+    /// Gets the serialized class ID for a value.
+    pub fn value_to_class_id(&self, sort: &ArcSort, value: &Value) -> egraph_serialize::ClassId {
+        // Canonicalize the value first so that we always use the canonical e-class ID
+        let mut value = *value;
+        sort.canonicalize(&mut value, &self.unionfind);
+        assert!(
+            !sort.name().to_string().contains('-'),
+            "Tag cannot contain '-' when serializing"
+        );
+        format!("{}-{}", sort.name(), value.bits).into()
+    }
+
+    /// Gets the value for a serialized class ID.
+    pub fn class_id_to_value(&self, eclass_id: &egraph_serialize::ClassId) -> Value {
+        let s = eclass_id.to_string();
+        let (tag, bits) = s.split_once('-').unwrap();
+        #[cfg(not(debug_assertions))]
+        let _ = tag;
+        Value {
+            #[cfg(debug_assertions)]
+            tag: tag.into(),
+            bits: bits.parse().unwrap(),
+        }
+    }
+
+    /// Gets the serialized node ID for the primitive, omitted, or function value.
+    pub fn to_node_id(
+        &self,
+        sort: Option<&ArcSort>,
+        node: SerializedNode,
+    ) -> egraph_serialize::NodeId {
+        match node {
+            SerializedNode::Function { name, offset } => {
+                assert!(sort.is_none());
+                format!("function-{}-{}", offset, name).into()
+            }
+            SerializedNode::Primitive(value) => format!(
+                "primitive-{}",
+                self.value_to_class_id(sort.unwrap(), &value)
+            )
+            .into(),
+            SerializedNode::Dummy(value) => {
+                format!("dummy-{}", self.value_to_class_id(sort.unwrap(), &value)).into()
+            }
+            SerializedNode::Split(node) => format!("split-{}", self.to_node_id(sort, *node)).into(),
+        }
+    }
+
+    /// Gets the serialized node for the node ID.
+    pub fn from_node_id(&self, node_id: &egraph_serialize::NodeId) -> SerializedNode {
+        let node_id = node_id.to_string();
+        let (tag, rest) = node_id.split_once('-').unwrap();
+        match tag {
+            "function" => {
+                let (offset, name) = rest.split_once('-').unwrap();
+                SerializedNode::Function {
+                    name: name.into(),
+                    offset: offset.parse().unwrap(),
+                }
+            }
+            "primitive" => {
+                let class_id: egraph_serialize::ClassId = rest.into();
+                SerializedNode::Primitive(self.class_id_to_value(&class_id))
+            }
+            "dummy" => {
+                let class_id: egraph_serialize::ClassId = rest.into();
+                SerializedNode::Dummy(self.class_id_to_value(&class_id))
+            }
+            "split" => {
+                let (_offset, rest) = rest.split_once('-').unwrap();
+                let node_id: egraph_serialize::NodeId = rest.into();
+                SerializedNode::Split(Box::new(self.from_node_id(&node_id)))
+            }
+            _ => std::panic::panic_any(format!("Unknown node ID: {}-{}", tag, rest)),
+        }
+    }
+
+    /// Serialize the value and return the eclass and node ID
+    /// If this is a primitive value, we will add the node to the data, but if it is an eclass, we will not
+    /// When this is called on the output of a node, we only use the e-class to know which e-class its a part of
+    /// When this is called on an input of a node, we only use the node ID to know which node to point to.
+    fn serialize_value(
+        &self,
+        egraph: &mut egraph_serialize::EGraph,
+        node_ids: &mut NodeIDs,
+        sort: &ArcSort,
+        value: &Value,
+        class_id: &egraph_serialize::ClassId,
+    ) -> egraph_serialize::NodeId {
+        let node_id = if sort.is_eq_sort() {
+            let node_ids = node_ids.entry(class_id.clone()).or_insert_with(|| {
+                // If we don't find node IDs for this class, it means that all nodes for it were omitted due to size constraints
+                // In this case, add a dummy node in this class to represent the missing nodes
+                let node_id = self.to_node_id(Some(sort), SerializedNode::Dummy(*value));
+                egraph.nodes.insert(
+                    node_id.clone(),
+                    egraph_serialize::Node {
+                        op: "[...]".to_string(),
+                        eclass: class_id.clone(),
+                        cost: NotNan::new(f64::INFINITY).unwrap(),
+                        children: vec![],
+                        subsumed: false,
+                    },
+                );
+                VecDeque::from(vec![node_id])
+            });
+            node_ids.rotate_left(1);
+            node_ids.front().unwrap().clone()
+        } else {
+            let node_id = self.to_node_id(Some(sort), SerializedNode::Primitive(*value));
+            // Add node for value
+            {
+                // Children will be empty unless this is a container sort
+                let children: Vec<egraph_serialize::NodeId> = sort
+                    .inner_values(value)
+                    .into_iter()
+                    .map(|(s, v)| {
+                        self.serialize_value(
+                            egraph,
+                            node_ids,
+                            &s,
+                            &v,
+                            &self.value_to_class_id(&s, &v),
+                        )
+                    })
+                    .collect();
+                // If this is a container sort, use the name, otherwise use the value
+                let op = if sort.is_container_sort() {
+                    sort.serialized_name(value).to_string()
+                } else {
+                    sort.make_expr(self, *value).1.to_string()
+                };
+                egraph.nodes.insert(
+                    node_id.clone(),
+                    egraph_serialize::Node {
+                        op,
+                        eclass: class_id.clone(),
+                        cost: NotNan::new(1.0).unwrap(),
+                        children,
+                        subsumed: false,
+                    },
+                );
+            };
+            node_id
+        };
+        egraph.class_data.insert(
+            class_id.clone(),
+            egraph_serialize::ClassData {
+                typ: Some(sort.name().to_string()),
+            },
+        );
+        node_id
+    }
+}
+
+type NodeIDs = HashMap<egraph_serialize::ClassId, VecDeque<egraph_serialize::NodeId>>;
+
\ No newline at end of file diff --git a/docs/src/egglog/sort/bigint.rs.html b/docs/src/egglog/sort/bigint.rs.html new file mode 100644 index 00000000..44e5a8ad --- /dev/null +++ b/docs/src/egglog/sort/bigint.rs.html @@ -0,0 +1,205 @@ +bigint.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+
use num::BigInt;
+use std::ops::{Shl, Shr};
+use std::sync::Mutex;
+
+type Z = BigInt;
+use crate::{ast::Literal, util::IndexSet};
+
+use super::*;
+
+lazy_static! {
+    static ref BIG_INT_SORT_NAME: Symbol = "BigInt".into();
+    static ref INTS: Mutex<IndexSet<Z>> = Default::default();
+}
+
+#[derive(Debug)]
+pub struct BigIntSort;
+
+impl Sort for BigIntSort {
+    fn name(&self) -> Symbol {
+        *BIG_INT_SORT_NAME
+    }
+
+    fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static> {
+        self
+    }
+
+    #[rustfmt::skip]
+    fn register_primitives(self: Arc<Self>, eg: &mut TypeInfo) {
+        type Opt<T=()> = Option<T>;
+
+        add_primitives!(eg, "bigint" = |a: i64| -> Z { a.into() });
+
+        add_primitives!(eg, "+" = |a: Z, b: Z| -> Z { a + b });
+        add_primitives!(eg, "-" = |a: Z, b: Z| -> Z { a - b });
+        add_primitives!(eg, "*" = |a: Z, b: Z| -> Z { a * b });
+        add_primitives!(eg, "/" = |a: Z, b: Z| -> Opt<Z> { (b != BigInt::ZERO).then(|| a / b) });
+        add_primitives!(eg, "%" = |a: Z, b: Z| -> Opt<Z> { (b != BigInt::ZERO).then(|| a % b) });
+
+        add_primitives!(eg, "&" = |a: Z, b: Z| -> Z { a & b });
+        add_primitives!(eg, "|" = |a: Z, b: Z| -> Z { a | b });
+        add_primitives!(eg, "^" = |a: Z, b: Z| -> Z { a ^ b });
+        add_primitives!(eg, "<<" = |a: Z, b: i64| -> Z { a.shl(b) });
+        add_primitives!(eg, ">>" = |a: Z, b: i64| -> Z { a.shr(b) });
+        add_primitives!(eg, "not-Z" = |a: Z| -> Z { !a });
+
+        add_primitives!(eg, "bits" = |a: Z| -> Z { a.bits().into() });
+
+        add_primitives!(eg, "<" = |a: Z, b: Z| -> Opt { (a < b).then_some(()) });
+        add_primitives!(eg, ">" = |a: Z, b: Z| -> Opt { (a > b).then_some(()) });
+        add_primitives!(eg, "<=" = |a: Z, b: Z| -> Opt { (a <= b).then_some(()) });
+        add_primitives!(eg, ">=" = |a: Z, b: Z| -> Opt { (a >= b).then_some(()) });
+
+        add_primitives!(eg, "bool-=" = |a: Z, b: Z| -> bool { a == b });
+        add_primitives!(eg, "bool-<" = |a: Z, b: Z| -> bool { a < b });
+        add_primitives!(eg, "bool->" = |a: Z, b: Z| -> bool { a > b });
+        add_primitives!(eg, "bool-<=" = |a: Z, b: Z| -> bool { a <= b });
+        add_primitives!(eg, "bool->=" = |a: Z, b: Z| -> bool { a >= b });
+
+        add_primitives!(eg, "min" = |a: Z, b: Z| -> Z { a.min(b) });
+        add_primitives!(eg, "max" = |a: Z, b: Z| -> Z { a.max(b) });
+
+        add_primitives!(eg, "to-string" = |a: Z| -> Symbol { a.to_string().into() });
+        add_primitives!(eg, "from-string" = |a: Symbol| -> Opt<Z> { a.as_str().parse::<Z>().ok() });
+   }
+
+    fn make_expr(&self, _egraph: &EGraph, value: Value) -> (Cost, Expr) {
+        #[cfg(debug_assertions)]
+        debug_assert_eq!(value.tag, self.name());
+
+        let bigint = Z::load(self, &value);
+        (
+            1,
+            Expr::call_no_span(
+                "from-string",
+                vec![GenericExpr::Lit(
+                    DUMMY_SPAN.clone(),
+                    Literal::String(bigint.to_string().into()),
+                )],
+            ),
+        )
+    }
+}
+
+impl FromSort for Z {
+    type Sort = BigIntSort;
+    fn load(_sort: &Self::Sort, value: &Value) -> Self {
+        let i = value.bits as usize;
+        INTS.lock().unwrap().get_index(i).unwrap().clone()
+    }
+}
+
+impl IntoSort for Z {
+    type Sort = BigIntSort;
+    fn store(self, _sort: &Self::Sort) -> Option<Value> {
+        let (i, _) = INTS.lock().unwrap().insert_full(self);
+        Some(Value {
+            #[cfg(debug_assertions)]
+            tag: BigIntSort.name(),
+            bits: i as u64,
+        })
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/sort/bigrat.rs.html b/docs/src/egglog/sort/bigrat.rs.html new file mode 100644 index 00000000..a241b3a6 --- /dev/null +++ b/docs/src/egglog/sort/bigrat.rs.html @@ -0,0 +1,311 @@ +bigrat.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+
use num::traits::{CheckedAdd, CheckedDiv, CheckedMul, CheckedSub, One, Signed, ToPrimitive, Zero};
+use num::{rational::BigRational, BigInt};
+use std::sync::Mutex;
+
+type Z = BigInt;
+type Q = BigRational;
+use crate::{ast::Literal, util::IndexSet};
+
+use super::*;
+
+lazy_static! {
+    static ref BIG_RAT_SORT_NAME: Symbol = "BigRat".into();
+    static ref RATS: Mutex<IndexSet<Q>> = Default::default();
+}
+
+#[derive(Debug)]
+pub struct BigRatSort;
+
+impl Sort for BigRatSort {
+    fn name(&self) -> Symbol {
+        *BIG_RAT_SORT_NAME
+    }
+
+    fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static> {
+        self
+    }
+
+    #[rustfmt::skip]
+    fn register_primitives(self: Arc<Self>, eg: &mut TypeInfo) {
+        type Opt<T=()> = Option<T>;
+
+        add_primitives!(eg, "+" = |a: Q, b: Q| -> Opt<Q> { a.checked_add(&b) });
+        add_primitives!(eg, "-" = |a: Q, b: Q| -> Opt<Q> { a.checked_sub(&b) });
+        add_primitives!(eg, "*" = |a: Q, b: Q| -> Opt<Q> { a.checked_mul(&b) });
+        add_primitives!(eg, "/" = |a: Q, b: Q| -> Opt<Q> { a.checked_div(&b) });
+
+        add_primitives!(eg, "min" = |a: Q, b: Q| -> Q { a.min(b) });
+        add_primitives!(eg, "max" = |a: Q, b: Q| -> Q { a.max(b) });
+        add_primitives!(eg, "neg" = |a: Q| -> Q { -a });
+        add_primitives!(eg, "abs" = |a: Q| -> Q { a.abs() });
+        add_primitives!(eg, "floor" = |a: Q| -> Q { a.floor() });
+        add_primitives!(eg, "ceil" = |a: Q| -> Q { a.ceil() });
+        add_primitives!(eg, "round" = |a: Q| -> Q { a.round() });
+        add_primitives!(eg, "bigrat" = |a: Z, b: Z| -> Q { Q::new(a, b) });
+        add_primitives!(eg, "numer" = |a: Q| -> Z { a.numer().clone() });
+        add_primitives!(eg, "denom" = |a: Q| -> Z { a.denom().clone() });
+
+        add_primitives!(eg, "to-f64" = |a: Q| -> f64 { a.to_f64().unwrap() });
+
+        add_primitives!(eg, "pow" = |a: Q, b: Q| -> Option<Q> {
+            if a.is_zero() {
+                if b.is_positive() {
+                    Some(Q::zero())
+                } else {
+                    None
+                }
+            } else if b.is_zero() {
+                Some(Q::one())
+            } else if let Some(b) = b.to_i64() {
+                if let Ok(b) = usize::try_from(b) {
+                    num::traits::checked_pow(a, b)
+                } else {
+                    // TODO handle negative powers
+                    None
+                }
+            } else {
+                None
+            }
+        });
+        add_primitives!(eg, "log" = |a: Q| -> Option<Q> {
+            if a.is_one() {
+                Some(Q::zero())
+            } else {
+                todo!()
+            }
+        });
+        add_primitives!(eg, "sqrt" = |a: Q| -> Option<Q> {
+            if a.numer().is_positive() && a.denom().is_positive() {
+                let s1 = a.numer().sqrt();
+                let s2 = a.denom().sqrt();
+                let is_perfect = &(s1.clone() * s1.clone()) == a.numer() && &(s2.clone() * s2.clone()) == a.denom();
+                if is_perfect {
+                    Some(Q::new(s1, s2))
+                } else {
+                    None
+                }
+            } else {
+                None
+            }
+        });
+        add_primitives!(eg, "cbrt" = |a: Q| -> Option<Q> {
+            if a.is_one() {
+                Some(Q::one())
+            } else {
+                todo!()
+            }
+        });
+
+        add_primitives!(eg, "<" = |a: Q, b: Q| -> Opt { if a < b {Some(())} else {None} });
+        add_primitives!(eg, ">" = |a: Q, b: Q| -> Opt { if a > b {Some(())} else {None} });
+        add_primitives!(eg, "<=" = |a: Q, b: Q| -> Opt { if a <= b {Some(())} else {None} });
+        add_primitives!(eg, ">=" = |a: Q, b: Q| -> Opt { if a >= b {Some(())} else {None} });
+   }
+
+    fn make_expr(&self, _egraph: &EGraph, value: Value) -> (Cost, Expr) {
+        #[cfg(debug_assertions)]
+        debug_assert_eq!(value.tag, self.name());
+
+        let rat = Q::load(self, &value);
+        let numer = rat.numer();
+        let denom = rat.denom();
+        (
+            1,
+            Expr::call_no_span(
+                "bigrat",
+                vec![
+                    Expr::call_no_span(
+                        "from-string",
+                        vec![GenericExpr::Lit(
+                            DUMMY_SPAN.clone(),
+                            Literal::String(numer.to_string().into()),
+                        )],
+                    ),
+                    Expr::call_no_span(
+                        "from-string",
+                        vec![GenericExpr::Lit(
+                            DUMMY_SPAN.clone(),
+                            Literal::String(denom.to_string().into()),
+                        )],
+                    ),
+                ],
+            ),
+        )
+    }
+}
+
+impl FromSort for Q {
+    type Sort = BigRatSort;
+    fn load(_sort: &Self::Sort, value: &Value) -> Self {
+        let i = value.bits as usize;
+        RATS.lock().unwrap().get_index(i).unwrap().clone()
+    }
+}
+
+impl IntoSort for Q {
+    type Sort = BigRatSort;
+    fn store(self, _sort: &Self::Sort) -> Option<Value> {
+        let (i, _) = RATS.lock().unwrap().insert_full(self);
+        Some(Value {
+            #[cfg(debug_assertions)]
+            tag: BigRatSort.name(),
+            bits: i as u64,
+        })
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/sort/bool.rs.html b/docs/src/egglog/sort/bool.rs.html new file mode 100644 index 00000000..b5a3007c --- /dev/null +++ b/docs/src/egglog/sort/bool.rs.html @@ -0,0 +1,115 @@ +bool.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
use crate::ast::Literal;
+
+use super::*;
+
+#[derive(Debug)]
+pub struct BoolSort;
+
+lazy_static! {
+    static ref BOOL_SORT_NAME: Symbol = "bool".into();
+}
+
+impl Sort for BoolSort {
+    fn name(&self) -> Symbol {
+        *BOOL_SORT_NAME
+    }
+
+    fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static> {
+        self
+    }
+
+    #[rustfmt::skip]
+    fn register_primitives(self: Arc<Self>, eg: &mut TypeInfo) {
+        add_primitives!(eg, "not" = |a: bool| -> bool { !a });
+        add_primitives!(eg, "and" = |a: bool, b: bool| -> bool { a && b });
+        add_primitives!(eg, "or" = |a: bool, b: bool| -> bool { a || b });
+        add_primitives!(eg, "xor" = |a: bool, b: bool| -> bool { a ^ b });
+        add_primitives!(eg, "=>" = |a: bool, b: bool| -> bool { !a || b });
+    }
+
+    fn make_expr(&self, _egraph: &EGraph, value: Value) -> (Cost, Expr) {
+        #[cfg(debug_assertions)]
+        debug_assert_eq!(value.tag, self.name());
+
+        (
+            1,
+            GenericExpr::Lit(DUMMY_SPAN.clone(), Literal::Bool(value.bits > 0)),
+        )
+    }
+}
+
+impl IntoSort for bool {
+    type Sort = BoolSort;
+    fn store(self, _sort: &Self::Sort) -> Option<Value> {
+        Some(Value {
+            #[cfg(debug_assertions)]
+            tag: BoolSort.name(),
+            bits: self as u64,
+        })
+    }
+}
+
+impl FromSort for bool {
+    type Sort = BoolSort;
+    fn load(_sort: &Self::Sort, value: &Value) -> Self {
+        value.bits != 0
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/sort/f64.rs.html b/docs/src/egglog/sort/f64.rs.html new file mode 100644 index 00000000..75481f92 --- /dev/null +++ b/docs/src/egglog/sort/f64.rs.html @@ -0,0 +1,167 @@ +f64.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+
use super::*;
+use crate::ast::Literal;
+use ordered_float::OrderedFloat;
+
+#[derive(Debug)]
+pub struct F64Sort;
+
+lazy_static! {
+    static ref F64_SORT_NAME: Symbol = "f64".into();
+}
+
+impl Sort for F64Sort {
+    fn name(&self) -> Symbol {
+        *F64_SORT_NAME
+    }
+
+    fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static> {
+        self
+    }
+
+    #[rustfmt::skip]
+    // We need the closure for division and mod operations, as they can panic.
+    // cf https://github.com/rust-lang/rust-clippy/issues/9422
+    #[allow(clippy::unnecessary_lazy_evaluations)]
+    fn register_primitives(self: Arc<Self>, eg: &mut TypeInfo) {
+        type Opt<T=()> = Option<T>;
+
+        add_primitives!(eg, "neg" = |a: f64| -> f64 { -a });
+
+        add_primitives!(eg, "+" = |a: f64, b: f64| -> f64 { a + b });
+        add_primitives!(eg, "-" = |a: f64, b: f64| -> f64 { a - b });
+        add_primitives!(eg, "*" = |a: f64, b: f64| -> f64 { a * b });
+        add_primitives!(eg, "^" = |a: f64, b: f64| -> f64 { a.powf(b) });
+        add_primitives!(eg, "/" = |a: f64, b: f64| -> Opt<f64> { (b != 0.0).then(|| a / b) });
+        add_primitives!(eg, "%" = |a: f64, b: f64| -> Opt<f64> { (b != 0.0).then(|| a % b) });
+
+        add_primitives!(eg, "<" = |a: f64, b: f64| -> Opt { (a < b).then(|| ()) });
+        add_primitives!(eg, ">" = |a: f64, b: f64| -> Opt { (a > b).then(|| ()) });
+        add_primitives!(eg, "<=" = |a: f64, b: f64| -> Opt { (a <= b).then(|| ()) });
+        add_primitives!(eg, ">=" = |a: f64, b: f64| -> Opt { (a >= b).then(|| ()) });
+
+        add_primitives!(eg, "min" = |a: f64, b: f64| -> f64 { a.min(b) });
+        add_primitives!(eg, "max" = |a: f64, b: f64| -> f64 { a.max(b) });
+        add_primitives!(eg, "abs" = |a: f64| -> f64 { a.abs() });
+
+        add_primitives!(eg, "to-f64" = |a: i64| -> f64 { a as f64 });
+        add_primitives!(eg, "to-i64" = |a: f64| -> i64 { a as i64 });
+        // Use debug instead of to_string so that decimal place is always printed
+        add_primitives!(eg, "to-string" = |a: f64| -> Symbol { format!("{:?}", a).into() });
+
+    }
+
+    fn make_expr(&self, _egraph: &EGraph, value: Value) -> (Cost, Expr) {
+        #[cfg(debug_assertions)]
+        debug_assert_eq!(value.tag, self.name());
+
+        (
+            1,
+            GenericExpr::Lit(
+                DUMMY_SPAN.clone(),
+                Literal::F64(OrderedFloat(f64::from_bits(value.bits))),
+            ),
+        )
+    }
+}
+
+impl IntoSort for f64 {
+    type Sort = F64Sort;
+    fn store(self, _sort: &Self::Sort) -> Option<Value> {
+        Some(Value {
+            #[cfg(debug_assertions)]
+            tag: F64Sort.name(),
+            bits: self.to_bits(),
+        })
+    }
+}
+
+impl FromSort for f64 {
+    type Sort = F64Sort;
+    fn load(_sort: &Self::Sort, value: &Value) -> Self {
+        f64::from_bits(value.bits)
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/sort/fn.rs.html b/docs/src/egglog/sort/fn.rs.html new file mode 100644 index 00000000..5c0f5727 --- /dev/null +++ b/docs/src/egglog/sort/fn.rs.html @@ -0,0 +1,889 @@ +fn.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+
//! Sort to represent functions as values.
+//!
+//! To declare the sort, you must specify the exact number of arguments and the sort of each, followed by the output sort:
+//! `(sort IntToString (UnstableFn (i64) String))`
+//!
+//! To create a function value, use the `(unstable-fn "name" [<partial args>])` primitive and to apply it use the `(unstable-app function arg1 arg2 ...)` primitive.
+//! The number of args must match the number of arguments in the function sort.
+//!
+//!
+//! The value is stored similar to the `vec` sort, as an index into a set, where each item in
+//! the set is a `(Symbol, Vec<Value>)` pairs. The Symbol is the function name, and the `Vec<Value>` is
+//! the list of partially applied arguments.
+use std::sync::Mutex;
+
+use crate::ast::Literal;
+
+use super::*;
+
+/// A function value is a name of a function, a list of partially applied arguments (values and sort)
+/// Note that we must store the actual arcsorts so we can return them when returning inner values
+/// and when canonicalizing
+#[derive(Debug, Clone)]
+struct ValueFunction(Symbol, Vec<(ArcSort, Value)>);
+
+impl ValueFunction {
+    /// Remove the arcsorts to make this hashable
+    /// The arg values contain the sort name anyways
+    fn hashable(&self) -> (Symbol, Vec<&Value>) {
+        (self.0, self.1.iter().map(|(_, v)| v).collect())
+    }
+}
+
+impl Hash for ValueFunction {
+    fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
+        self.hashable().hash(state);
+    }
+}
+
+impl PartialEq for ValueFunction {
+    fn eq(&self, other: &Self) -> bool {
+        self.hashable() == other.hashable()
+    }
+}
+
+impl Eq for ValueFunction {}
+
+#[derive(Debug)]
+pub struct FunctionSort {
+    name: Symbol,
+    // Public so that other primitive sorts (external or internal) can find a function sort by the sorts of its inputs/output
+    pub inputs: Vec<ArcSort>,
+    pub output: ArcSort,
+    functions: Mutex<IndexSet<ValueFunction>>,
+}
+
+impl FunctionSort {
+    fn get_value(&self, value: &Value) -> ValueFunction {
+        let functions = self.functions.lock().unwrap();
+        functions.get_index(value.bits as usize).unwrap().clone()
+    }
+
+    /// Apply the function to the values
+    ///
+    /// Public so that other primitive sorts (external or internal) can use this to apply functions
+    pub fn apply(&self, fn_value: &Value, arg_values: &[Value], egraph: &mut EGraph) -> Value {
+        let ValueFunction(name, args) = self.get_value(fn_value);
+        let types: Vec<_> = args
+            .iter()
+            .map(|(sort, _)| sort.clone())
+            .chain(self.inputs.clone())
+            .chain(once(self.output.clone()))
+            .collect();
+        let values = args
+            .iter()
+            .map(|(_, v)| *v)
+            .chain(arg_values.iter().cloned())
+            .collect();
+        call_fn(egraph, &name, types, values)
+    }
+}
+
+impl Presort for FunctionSort {
+    fn presort_name() -> Symbol {
+        "UnstableFn".into()
+    }
+
+    fn reserved_primitives() -> Vec<Symbol> {
+        vec!["unstable-fn".into(), "unstable-app".into()]
+    }
+
+    fn make_sort(
+        typeinfo: &mut TypeInfo,
+        name: Symbol,
+        args: &[Expr],
+    ) -> Result<ArcSort, TypeError> {
+        if let [inputs, Expr::Var(span, output)] = args {
+            let output_sort = typeinfo
+                .sorts
+                .get(output)
+                .ok_or(TypeError::UndefinedSort(*output, span.clone()))?;
+
+            let input_sorts = match inputs {
+                Expr::Call(_, first, rest_args) => {
+                    let all_args = once(first).chain(rest_args.iter().map(|arg| {
+                        if let Expr::Var(_, arg) = arg {
+                            arg
+                        } else {
+                            panic!("function sort must be called with list of input sorts");
+                        }
+                    }));
+                    all_args
+                        .map(|arg| {
+                            typeinfo
+                                .sorts
+                                .get(arg)
+                                .ok_or(TypeError::UndefinedSort(*arg, span.clone()))
+                                .cloned()
+                        })
+                        .collect::<Result<Vec<_>, _>>()?
+                }
+                // an empty list of inputs args is parsed as a unit literal
+                Expr::Lit(_, Literal::Unit) => vec![],
+                _ => panic!("function sort must be called with list of input sorts"),
+            };
+
+            Ok(Arc::new(Self {
+                name,
+                inputs: input_sorts,
+                output: output_sort.clone(),
+                functions: Default::default(),
+            }))
+        } else {
+            panic!("function sort must be called with list of input args and output sort");
+        }
+    }
+}
+
+impl Sort for FunctionSort {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static> {
+        self
+    }
+
+    fn is_container_sort(&self) -> bool {
+        true
+    }
+
+    fn is_eq_container_sort(&self) -> bool {
+        self.inputs.iter().any(|s| s.is_eq_sort())
+    }
+
+    fn serialized_name(&self, value: &Value) -> Symbol {
+        self.get_value(value).0
+    }
+
+    fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)> {
+        let functions = self.functions.lock().unwrap();
+        let input_values = functions.get_index(value.bits as usize).unwrap();
+        input_values.1.clone()
+    }
+
+    fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool {
+        let ValueFunction(name, inputs) = self.get_value(value);
+        let mut changed = false;
+        let mut new_outputs = vec![];
+        for (s, mut v) in inputs.into_iter() {
+            changed |= s.canonicalize(&mut v, unionfind);
+            new_outputs.push((s, v));
+        }
+        *value = ValueFunction(name, new_outputs).store(self).unwrap();
+        changed
+    }
+
+    fn register_primitives(self: Arc<Self>, typeinfo: &mut TypeInfo) {
+        typeinfo.add_primitive(Ctor {
+            name: "unstable-fn".into(),
+            function: self.clone(),
+        });
+        typeinfo.add_primitive(Apply {
+            name: "unstable-app".into(),
+            function: self.clone(),
+        });
+    }
+
+    fn make_expr(&self, egraph: &EGraph, value: Value) -> (Cost, Expr) {
+        let mut termdag = TermDag::default();
+        let extractor = Extractor::new(egraph, &mut termdag);
+        self.extract_expr(egraph, value, &extractor, &mut termdag)
+            .expect("Extraction should be successful since extractor has been fully initialized")
+    }
+
+    fn extract_expr(
+        &self,
+        _egraph: &EGraph,
+        value: Value,
+        extractor: &Extractor,
+        termdag: &mut TermDag,
+    ) -> Option<(Cost, Expr)> {
+        let ValueFunction(name, inputs) = ValueFunction::load(self, &value);
+        let (cost, args) = inputs.into_iter().try_fold(
+            (
+                1usize,
+                vec![GenericExpr::Lit(DUMMY_SPAN.clone(), Literal::String(name))],
+            ),
+            |(cost, mut args), (sort, value)| {
+                let (new_cost, term) = extractor.find_best(value, termdag, &sort)?;
+                args.push(termdag.term_to_expr(&term));
+                Some((cost.saturating_add(new_cost), args))
+            },
+        )?;
+
+        Some((cost, Expr::call_no_span("unstable-fn", args)))
+    }
+}
+
+impl IntoSort for ValueFunction {
+    type Sort = FunctionSort;
+    fn store(self, sort: &Self::Sort) -> Option<Value> {
+        let mut functions = sort.functions.lock().unwrap();
+        let (i, _) = functions.insert_full(self);
+        Some(Value {
+            #[cfg(debug_assertions)]
+            tag: sort.name,
+            bits: i as u64,
+        })
+    }
+}
+
+impl FromSort for ValueFunction {
+    type Sort = FunctionSort;
+    fn load(sort: &Self::Sort, value: &Value) -> Self {
+        sort.get_value(value)
+    }
+}
+
+/// Takes a string and any number of partially applied args of any sort and returns a function
+struct FunctionCTorTypeConstraint {
+    name: Symbol,
+    function: Arc<FunctionSort>,
+    span: Span,
+}
+
+impl TypeConstraint for FunctionCTorTypeConstraint {
+    fn get(
+        &self,
+        arguments: &[AtomTerm],
+        typeinfo: &TypeInfo,
+    ) -> Vec<Constraint<AtomTerm, ArcSort>> {
+        // Must have at least one arg (plus the return value)
+        if arguments.len() < 2 {
+            return vec![Constraint::Impossible(
+                constraint::ImpossibleConstraint::ArityMismatch {
+                    atom: core::Atom {
+                        span: self.span.clone(),
+                        head: self.name,
+                        args: arguments.to_vec(),
+                    },
+                    expected: 1,
+                    actual: 0,
+                },
+            )];
+        }
+        let output_sort_constraint: constraint::Constraint<_, ArcSort> = Constraint::Assign(
+            arguments[arguments.len() - 1].clone(),
+            self.function.clone(),
+        );
+        // If first arg is a literal string and we know the name of the function and can use that to know what
+        // types to expect
+        if let AtomTerm::Literal(_, Literal::String(ref name)) = arguments[0] {
+            if let Some(func_type) = typeinfo.func_types.get(name) {
+                // The arguments contains the return sort as well as the function name
+                let n_partial_args = arguments.len() - 2;
+                // the number of partial args must match the number of inputs from the func type minus the number from
+                // this function sort
+                if self.function.inputs.len() + n_partial_args != func_type.input.len() {
+                    return vec![Constraint::Impossible(
+                        constraint::ImpossibleConstraint::ArityMismatch {
+                            atom: core::Atom {
+                                span: self.span.clone(),
+                                head: self.name,
+                                args: arguments.to_vec(),
+                            },
+                            expected: self.function.inputs.len() + func_type.input.len() + 1,
+                            actual: arguments.len() - 1,
+                        },
+                    )];
+                }
+                // the output type and input types (starting after the partial args) must match between these functions
+                let expected_output = self.function.output.clone();
+                let expected_input = self.function.inputs.clone();
+                let actual_output = func_type.output.clone();
+                let actual_input: Vec<ArcSort> = func_type
+                    .input
+                    .iter()
+                    .skip(n_partial_args)
+                    .cloned()
+                    .collect();
+                if expected_output.name() != actual_output.name()
+                    || expected_input
+                        .iter()
+                        .map(|s| s.name())
+                        .ne(actual_input.iter().map(|s| s.name()))
+                {
+                    return vec![Constraint::Impossible(
+                        constraint::ImpossibleConstraint::FunctionMismatch {
+                            expected_output,
+                            expected_input,
+                            actual_output,
+                            actual_input,
+                        },
+                    )];
+                }
+                // if they match, then just make sure the partial args match as well
+                return func_type
+                    .input
+                    .iter()
+                    .take(n_partial_args)
+                    .zip(arguments.iter().skip(1))
+                    .map(|(expected_sort, actual_term)| {
+                        Constraint::Assign(actual_term.clone(), expected_sort.clone())
+                    })
+                    .chain(once(output_sort_constraint))
+                    .collect();
+            }
+        }
+
+        // Otherwise we just try assuming it's this function, we don't know if it is or not
+        vec![
+            Constraint::Assign(arguments[0].clone(), Arc::new(StringSort)),
+            output_sort_constraint,
+        ]
+    }
+}
+
+// (unstable-fn "name" [<arg1>, <arg2>, ...])
+struct Ctor {
+    name: Symbol,
+    function: Arc<FunctionSort>,
+}
+
+impl PrimitiveLike for Ctor {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        Box::new(FunctionCTorTypeConstraint {
+            name: self.name,
+            function: self.function.clone(),
+            span: span.clone(),
+        })
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let name = Symbol::load(&StringSort, &values[0]);
+
+        assert!(values.len() == sorts.0.len());
+        let args: Vec<(ArcSort, Value)> = values[1..]
+            .iter()
+            .zip(&sorts.0[1..])
+            .map(|(value, sort)| (sort.clone(), *value))
+            .collect();
+
+        ValueFunction(name, args).store(&self.function)
+    }
+}
+
+// (unstable-app <function> [<arg1>, <arg2>, ...])
+struct Apply {
+    name: Symbol,
+    function: Arc<FunctionSort>,
+}
+
+impl PrimitiveLike for Apply {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        let mut sorts: Vec<ArcSort> = vec![self.function.clone()];
+        sorts.extend(self.function.inputs.clone());
+        sorts.push(self.function.output.clone());
+        SimpleTypeConstraint::new(self.name(), sorts, span.clone()).into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let egraph = egraph.expect("`unstable-app` is not supported yet in facts.");
+        Some(self.function.apply(&values[0], &values[1..], egraph))
+    }
+}
+
+/// Call function (either primitive or eqsort) <name> with value args <args> and return the value.
+///
+/// Does this in a similar way to how merge functions are resolved, using the stack and actions,
+/// so that we can re-use the logic for primitive and regular functions.
+fn call_fn(egraph: &mut EGraph, name: &Symbol, types: Vec<ArcSort>, args: Vec<Value>) -> Value {
+    // Make a call with temp vars as each of the args
+    let resolved_call = ResolvedCall::from_resolution(name, types.as_slice(), &egraph.type_info);
+    let arg_vars: Vec<_> = types
+        .into_iter()
+        // Skip last sort which is the output sort
+        .take(args.len())
+        .enumerate()
+        .map(|(i, sort)| ResolvedVar {
+            name: format!("__arg_{}", i).into(),
+            sort,
+            is_global_ref: false,
+        })
+        .collect();
+    let binding = IndexSet::from_iter(arg_vars.clone());
+    let resolved_args = arg_vars
+        .into_iter()
+        .map(|v| GenericExpr::Var(DUMMY_SPAN.clone(), v))
+        .collect();
+    let expr = GenericExpr::Call(DUMMY_SPAN.clone(), resolved_call, resolved_args);
+    // Similar to how the merge function is created in `Function::new`
+    let (actions, mapped_expr) = expr
+        .to_core_actions(
+            &egraph.type_info,
+            &mut binding.clone(),
+            &mut egraph.symbol_gen,
+        )
+        .unwrap();
+    let target = mapped_expr.get_corresponding_var_or_lit(&egraph.type_info);
+    let program = egraph.compile_expr(&binding, &actions, &target).unwrap();
+    // Similar to how the `MergeFn::Expr` case is handled in `Egraph::perform_set`
+    // egraph.rebuild().unwrap();
+    let mut stack = vec![];
+    egraph.run_actions(&mut stack, &args, &program).unwrap();
+    stack.pop().unwrap()
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/sort/i64.rs.html b/docs/src/egglog/sort/i64.rs.html new file mode 100644 index 00000000..35f3c0be --- /dev/null +++ b/docs/src/egglog/sort/i64.rs.html @@ -0,0 +1,263 @@ +i64.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+
use crate::{ast::Literal, constraint::AllEqualTypeConstraint};
+
+use super::*;
+
+#[derive(Debug)]
+pub struct I64Sort;
+
+lazy_static! {
+    static ref I64_SORT_NAME: Symbol = "i64".into();
+}
+
+impl Sort for I64Sort {
+    fn name(&self) -> Symbol {
+        *I64_SORT_NAME
+    }
+
+    fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static> {
+        self
+    }
+
+    #[rustfmt::skip]
+    // We need the closure for division and mod operations, as they can panic.
+    // cf https://github.com/rust-lang/rust-clippy/issues/9422
+    #[allow(clippy::unnecessary_lazy_evaluations)]
+    fn register_primitives(self: Arc<Self>, typeinfo: &mut TypeInfo) {
+        typeinfo.add_primitive(TermOrderingMin {
+           });
+        typeinfo.add_primitive(TermOrderingMax {
+           });
+
+        type Opt<T=()> = Option<T>;
+
+        add_primitives!(typeinfo, "+" = |a: i64, b: i64| -> i64 { a + b });
+        add_primitives!(typeinfo, "-" = |a: i64, b: i64| -> i64 { a - b });
+        add_primitives!(typeinfo, "*" = |a: i64, b: i64| -> i64 { a * b });
+        add_primitives!(typeinfo, "/" = |a: i64, b: i64| -> Opt<i64> { (b != 0).then(|| a / b) });
+        add_primitives!(typeinfo, "%" = |a: i64, b: i64| -> Opt<i64> { (b != 0).then(|| a % b) });
+
+        add_primitives!(typeinfo, "&" = |a: i64, b: i64| -> i64 { a & b });
+        add_primitives!(typeinfo, "|" = |a: i64, b: i64| -> i64 { a | b });
+        add_primitives!(typeinfo, "^" = |a: i64, b: i64| -> i64 { a ^ b });
+        add_primitives!(typeinfo, "<<" = |a: i64, b: i64| -> Opt<i64> { b.try_into().ok().and_then(|b| a.checked_shl(b)) });
+        add_primitives!(typeinfo, ">>" = |a: i64, b: i64| -> Opt<i64> { b.try_into().ok().and_then(|b| a.checked_shr(b)) });
+        add_primitives!(typeinfo, "not-i64" = |a: i64| -> i64 { !a });
+
+        add_primitives!(typeinfo, "log2" = |a: i64| -> i64 { (a as i64).ilog2() as i64 });
+
+        add_primitives!(typeinfo, "<" = |a: i64, b: i64| -> Opt { (a < b).then_some(()) });
+        add_primitives!(typeinfo, ">" = |a: i64, b: i64| -> Opt { (a > b).then_some(()) });
+        add_primitives!(typeinfo, "<=" = |a: i64, b: i64| -> Opt { (a <= b).then_some(()) });
+        add_primitives!(typeinfo, ">=" = |a: i64, b: i64| -> Opt { (a >= b).then_some(()) });
+
+        add_primitives!(typeinfo, "bool-=" = |a: i64, b: i64| -> bool { a == b });
+        add_primitives!(typeinfo, "bool-<" = |a: i64, b: i64| -> bool { a < b });
+        add_primitives!(typeinfo, "bool->" = |a: i64, b: i64| -> bool { a > b });
+        add_primitives!(typeinfo, "bool-<=" = |a: i64, b: i64| -> bool { a <= b });
+        add_primitives!(typeinfo, "bool->=" = |a: i64, b: i64| -> bool { a >= b });
+
+        add_primitives!(typeinfo, "min" = |a: i64, b: i64| -> i64 { a.min(b) });
+        add_primitives!(typeinfo, "max" = |a: i64, b: i64| -> i64 { a.max(b) });
+
+        add_primitives!(typeinfo, "to-string" = |a: i64| -> Symbol { a.to_string().into() });
+
+        // Must be in the i64 sort register function because the string sort is registered before the i64 sort.
+        typeinfo.add_primitive(CountMatches {
+            name: "count-matches".into(),
+            string: typeinfo.get_sort_nofail(),
+            int: self.clone(),
+        });
+
+    }
+
+    fn make_expr(&self, _egraph: &EGraph, value: Value) -> (Cost, Expr) {
+        #[cfg(debug_assertions)]
+        debug_assert_eq!(value.tag, self.name());
+
+        (
+            1,
+            GenericExpr::Lit(DUMMY_SPAN.clone(), Literal::Int(value.bits as _)),
+        )
+    }
+}
+
+impl IntoSort for i64 {
+    type Sort = I64Sort;
+    fn store(self, _sort: &Self::Sort) -> Option<Value> {
+        Some(Value {
+            #[cfg(debug_assertions)]
+            tag: I64Sort.name(),
+            bits: self as u64,
+        })
+    }
+}
+
+impl FromSort for i64 {
+    type Sort = I64Sort;
+    fn load(_sort: &Self::Sort, value: &Value) -> Self {
+        value.bits as Self
+    }
+}
+
+struct CountMatches {
+    name: Symbol,
+    string: Arc<StringSort>,
+    int: Arc<I64Sort>,
+}
+
+impl PrimitiveLike for CountMatches {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        AllEqualTypeConstraint::new(self.name(), span.clone())
+            .with_all_arguments_sort(self.string.clone())
+            .with_exact_length(3)
+            .with_output_sort(self.int.clone())
+            .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let string1 = Symbol::load(&self.string, &values[0]).to_string();
+        let string2 = Symbol::load(&self.string, &values[1]).to_string();
+        Some(Value::from(string1.matches(&string2).count() as i64))
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/sort/macros.rs.html b/docs/src/egglog/sort/macros.rs.html new file mode 100644 index 00000000..0e7dc016 --- /dev/null +++ b/docs/src/egglog/sort/macros.rs.html @@ -0,0 +1,107 @@ +macros.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
macro_rules! add_primitives {
+    ($type_info:expr,
+        $name:literal = |$($param:ident : $param_t:ty),*| -> $ret:ty { $body:expr }
+    ) => {{
+        let type_info: &mut _ = $type_info;
+        #[allow(unused_imports, non_snake_case)]
+        {
+            use $crate::{*, sort::*, constraint::*};
+
+            struct MyPrim {$(
+                $param: Arc<<$param_t as FromSort>::Sort>,
+            )*
+                __out: Arc<<$ret as IntoSort>::Sort>,
+            }
+
+            impl $crate::PrimitiveLike for MyPrim {
+                fn name(&self) -> $crate::Symbol {
+                    $name.into()
+                }
+
+                fn get_type_constraints(
+                    &self,
+                    span: &Span
+                ) -> Box<dyn TypeConstraint> {
+                    let sorts = vec![$(self.$param.clone() as ArcSort,)* self.__out.clone() as ArcSort];
+                    SimpleTypeConstraint::new(self.name(), sorts, span.clone()).into_box()
+                }
+
+                fn apply(
+                    &self,
+                    values: &[Value],
+                    _sorts: (&[ArcSort], &ArcSort),
+                    _egraph: Option<&mut EGraph>,
+                ) -> Option<Value> {
+                    if let [$($param),*] = values {
+                        $(let $param: $param_t = <$param_t as FromSort>::load(&self.$param, $param);)*
+                        // print!("{}( ", $name);
+                        // $( print!("{}={:?}, ", stringify!($param), $param); )*
+                        let result: $ret = $body;
+                        // println!(") = {result:?}");
+                        result.store(&self.__out)
+                    } else {
+                        panic!("wrong number of arguments")
+                    }
+                }
+            }
+            type_info.add_primitive($crate::Primitive::from(MyPrim {
+                $( $param: type_info.get_sort_nofail::<<$param_t as IntoSort>::Sort>(), )*
+                __out: type_info.get_sort_nofail::<<$ret as IntoSort>::Sort>(),
+            }))
+        }
+    }};
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/sort/map.rs.html b/docs/src/egglog/sort/map.rs.html new file mode 100644 index 00000000..94fe90d9 --- /dev/null +++ b/docs/src/egglog/sort/map.rs.html @@ -0,0 +1,1085 @@ +map.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+
use std::collections::BTreeMap;
+use std::sync::Mutex;
+
+use crate::constraint::{AllEqualTypeConstraint, SimpleTypeConstraint};
+
+use super::*;
+
+type ValueMap = BTreeMap<Value, Value>;
+
+#[derive(Debug)]
+pub struct MapSort {
+    name: Symbol,
+    key: ArcSort,
+    value: ArcSort,
+    maps: Mutex<IndexSet<ValueMap>>,
+}
+
+impl MapSort {
+    fn key(&self) -> ArcSort {
+        self.key.clone()
+    }
+
+    fn value(&self) -> ArcSort {
+        self.value.clone()
+    }
+}
+
+impl Presort for MapSort {
+    fn presort_name() -> Symbol {
+        "Map".into()
+    }
+
+    fn reserved_primitives() -> Vec<Symbol> {
+        vec![
+            "rebuild".into(),
+            "map-empty".into(),
+            "map-insert".into(),
+            "map-get".into(),
+            "map-not-contains".into(),
+            "map-contains".into(),
+            "map-remove".into(),
+            "map-length".into(),
+        ]
+    }
+
+    fn make_sort(
+        typeinfo: &mut TypeInfo,
+        name: Symbol,
+        args: &[Expr],
+    ) -> Result<ArcSort, TypeError> {
+        if let [Expr::Var(k_span, k), Expr::Var(v_span, v)] = args {
+            let k = typeinfo
+                .sorts
+                .get(k)
+                .ok_or(TypeError::UndefinedSort(*k, k_span.clone()))?;
+            let v = typeinfo
+                .sorts
+                .get(v)
+                .ok_or(TypeError::UndefinedSort(*v, v_span.clone()))?;
+
+            // TODO: specialize the error message
+            if k.is_eq_container_sort() {
+                return Err(TypeError::DisallowedSort(
+                    name,
+                    "Maps nested with other EqSort containers are not allowed".into(),
+                    k_span.clone(),
+                ));
+            }
+
+            if v.is_container_sort() {
+                return Err(TypeError::DisallowedSort(
+                    name,
+                    "Maps nested with other EqSort containers are not allowed".into(),
+                    v_span.clone(),
+                ));
+            }
+
+            Ok(Arc::new(Self {
+                name,
+                key: k.clone(),
+                value: v.clone(),
+                maps: Default::default(),
+            }))
+        } else {
+            panic!()
+        }
+    }
+}
+
+impl Sort for MapSort {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static> {
+        self
+    }
+
+    fn is_container_sort(&self) -> bool {
+        true
+    }
+
+    fn is_eq_container_sort(&self) -> bool {
+        self.key.is_eq_sort() || self.value.is_eq_sort()
+    }
+
+    fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)> {
+        let maps = self.maps.lock().unwrap();
+        let map = maps.get_index(value.bits as usize).unwrap();
+        let mut result = Vec::new();
+        for (k, v) in map.iter() {
+            result.push((self.key.clone(), *k));
+            result.push((self.value.clone(), *v));
+        }
+        result
+    }
+
+    fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool {
+        let maps = self.maps.lock().unwrap();
+        let map = maps.get_index(value.bits as usize).unwrap();
+        let mut changed = false;
+        let new_map: ValueMap = map
+            .iter()
+            .map(|(k, v)| {
+                let (mut k, mut v) = (*k, *v);
+                changed |= self.key.canonicalize(&mut k, unionfind);
+                changed |= self.value.canonicalize(&mut v, unionfind);
+                (k, v)
+            })
+            .collect();
+        drop(maps);
+        *value = new_map.store(self).unwrap();
+        changed
+    }
+
+    fn register_primitives(self: Arc<Self>, typeinfo: &mut TypeInfo) {
+        typeinfo.add_primitive(MapRebuild {
+            name: "rebuild".into(),
+            map: self.clone(),
+        });
+        typeinfo.add_primitive(Ctor {
+            name: "map-empty".into(),
+            map: self.clone(),
+        });
+        typeinfo.add_primitive(Insert {
+            name: "map-insert".into(),
+            map: self.clone(),
+        });
+        typeinfo.add_primitive(Get {
+            name: "map-get".into(),
+            map: self.clone(),
+        });
+        typeinfo.add_primitive(NotContains {
+            name: "map-not-contains".into(),
+            map: self.clone(),
+        });
+        typeinfo.add_primitive(Contains {
+            name: "map-contains".into(),
+            map: self.clone(),
+        });
+        typeinfo.add_primitive(Remove {
+            name: "map-remove".into(),
+            map: self.clone(),
+        });
+        typeinfo.add_primitive(Length {
+            name: "map-length".into(),
+            map: self,
+        });
+    }
+
+    fn make_expr(&self, egraph: &EGraph, value: Value) -> (Cost, Expr) {
+        let mut termdag = TermDag::default();
+        let extractor = Extractor::new(egraph, &mut termdag);
+        self.extract_expr(egraph, value, &extractor, &mut termdag)
+            .expect("Extraction should be successful since extractor has been fully initialized")
+    }
+
+    fn extract_expr(
+        &self,
+        _egraph: &EGraph,
+        value: Value,
+        extractor: &Extractor,
+        termdag: &mut TermDag,
+    ) -> Option<(Cost, Expr)> {
+        let map = ValueMap::load(self, &value);
+        let mut expr = Expr::call_no_span("map-empty", []);
+        let mut cost = 0usize;
+        for (k, v) in map.iter().rev() {
+            let k = extractor.find_best(*k, termdag, &self.key)?;
+            let v = extractor.find_best(*v, termdag, &self.value)?;
+            cost = cost.saturating_add(k.0).saturating_add(v.0);
+            expr = Expr::call_no_span(
+                "map-insert",
+                [expr, termdag.term_to_expr(&k.1), termdag.term_to_expr(&v.1)],
+            )
+        }
+        Some((cost, expr))
+    }
+}
+
+impl IntoSort for ValueMap {
+    type Sort = MapSort;
+    fn store(self, sort: &Self::Sort) -> Option<Value> {
+        let mut maps = sort.maps.lock().unwrap();
+        let (i, _) = maps.insert_full(self);
+        Some(Value {
+            #[cfg(debug_assertions)]
+            tag: sort.name,
+            bits: i as u64,
+        })
+    }
+}
+
+impl FromSort for ValueMap {
+    type Sort = MapSort;
+    fn load(sort: &Self::Sort, value: &Value) -> Self {
+        let maps = sort.maps.lock().unwrap();
+        maps.get_index(value.bits as usize).unwrap().clone()
+    }
+}
+
+struct MapRebuild {
+    name: Symbol,
+    map: Arc<MapSort>,
+}
+
+impl PrimitiveLike for MapRebuild {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.map.clone(), self.map.clone()],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let egraph = egraph.unwrap();
+        let maps = self.map.maps.lock().unwrap();
+        let map = maps.get_index(values[0].bits as usize).unwrap();
+        let new_map: ValueMap = map
+            .iter()
+            .map(|(k, v)| {
+                (
+                    egraph.find(&self.map.key, *k),
+                    egraph.find(&self.map.value, *v),
+                )
+            })
+            .collect();
+
+        drop(maps);
+
+        let res = new_map.store(&self.map).unwrap();
+        Some(res)
+    }
+}
+
+struct Ctor {
+    name: Symbol,
+    map: Arc<MapSort>,
+}
+
+// TODO: move term ordering min/max to its own mod
+pub(crate) struct TermOrderingMin {}
+
+impl PrimitiveLike for TermOrderingMin {
+    fn name(&self) -> Symbol {
+        "ordering-min".into()
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        AllEqualTypeConstraint::new(self.name(), span.clone())
+            .with_exact_length(3)
+            .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        assert_eq!(values.len(), 2);
+        if values[0] < values[1] {
+            Some(values[0])
+        } else {
+            Some(values[1])
+        }
+    }
+}
+
+pub(crate) struct TermOrderingMax {}
+
+impl PrimitiveLike for TermOrderingMax {
+    fn name(&self) -> Symbol {
+        "ordering-max".into()
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        AllEqualTypeConstraint::new(self.name(), span.clone())
+            .with_exact_length(3)
+            .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        assert_eq!(values.len(), 2);
+        if values[0] > values[1] {
+            Some(values[0])
+        } else {
+            Some(values[1])
+        }
+    }
+}
+
+impl PrimitiveLike for Ctor {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(self.name(), vec![self.map.clone()], span.clone()).into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        assert!(values.is_empty());
+        ValueMap::default().store(&self.map)
+    }
+}
+
+struct Insert {
+    name: Symbol,
+    map: Arc<MapSort>,
+}
+
+impl PrimitiveLike for Insert {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![
+                self.map.clone(),
+                self.map.key(),
+                self.map.value(),
+                self.map.clone(),
+            ],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let mut map = ValueMap::load(&self.map, &values[0]);
+        map.insert(values[1], values[2]);
+        map.store(&self.map)
+    }
+}
+
+struct Get {
+    name: Symbol,
+    map: Arc<MapSort>,
+}
+
+impl PrimitiveLike for Get {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.map.clone(), self.map.key(), self.map.value()],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let map = ValueMap::load(&self.map, &values[0]);
+        map.get(&values[1]).copied()
+    }
+}
+
+struct NotContains {
+    name: Symbol,
+    map: Arc<MapSort>,
+}
+
+impl PrimitiveLike for NotContains {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.map.clone(), self.map.key(), Arc::new(UnitSort)],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let map = ValueMap::load(&self.map, &values[0]);
+        if map.contains_key(&values[1]) {
+            None
+        } else {
+            Some(Value::unit())
+        }
+    }
+}
+
+struct Contains {
+    name: Symbol,
+    map: Arc<MapSort>,
+}
+
+impl PrimitiveLike for Contains {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.map.clone(), self.map.key(), Arc::new(UnitSort)],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let map = ValueMap::load(&self.map, &values[0]);
+        if map.contains_key(&values[1]) {
+            Some(Value::unit())
+        } else {
+            None
+        }
+    }
+}
+
+struct Remove {
+    name: Symbol,
+    map: Arc<MapSort>,
+}
+
+impl PrimitiveLike for Remove {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.map.clone(), self.map.key(), self.map.clone()],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let mut map = ValueMap::load(&self.map, &values[0]);
+        map.remove(&values[1]);
+        map.store(&self.map)
+    }
+}
+
+struct Length {
+    name: Symbol,
+    map: Arc<MapSort>,
+}
+
+impl PrimitiveLike for Length {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.map.clone(), Arc::new(I64Sort)],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let map = ValueMap::load(&self.map, &values[0]);
+        Some(Value::from(map.len() as i64))
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/sort/mod.rs.html b/docs/src/egglog/sort/mod.rs.html new file mode 100644 index 00000000..6b9b107f --- /dev/null +++ b/docs/src/egglog/sort/mod.rs.html @@ -0,0 +1,459 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+
#[macro_use]
+mod macros;
+use lazy_static::lazy_static;
+use std::fmt::Debug;
+use std::{any::Any, sync::Arc};
+
+mod bigint;
+pub use bigint::*;
+mod bigrat;
+pub use bigrat::*;
+mod bool;
+pub use self::bool::*;
+mod rational;
+pub use rational::*;
+mod string;
+pub use string::*;
+mod unit;
+pub use unit::*;
+mod i64;
+pub use self::i64::*;
+mod f64;
+pub use self::f64::*;
+mod map;
+pub use map::*;
+mod set;
+pub use set::*;
+mod vec;
+pub use vec::*;
+mod r#fn;
+pub use r#fn::*;
+mod multiset;
+pub use multiset::*;
+
+use crate::constraint::AllEqualTypeConstraint;
+use crate::extract::{Cost, Extractor};
+use crate::*;
+
+pub trait Sort: Any + Send + Sync + Debug {
+    fn name(&self) -> Symbol;
+
+    fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>;
+
+    fn is_eq_sort(&self) -> bool {
+        false
+    }
+
+    // return true if it is a container sort.
+    fn is_container_sort(&self) -> bool {
+        false
+    }
+
+    // return true if it is a container sort that contains ids.
+    // only eq_sort and eq_container_sort need to be canonicalized.
+    fn is_eq_container_sort(&self) -> bool {
+        false
+    }
+
+    // Only eq_container_sort need to implement this method,
+    // which returns a list of ids to be tracked.
+    fn foreach_tracked_values<'a>(
+        &'a self,
+        value: &'a Value,
+        mut f: Box<dyn FnMut(ArcSort, Value) + 'a>,
+    ) {
+        for (sort, value) in self.inner_values(value) {
+            if sort.is_eq_sort() {
+                f(sort, value)
+            }
+        }
+    }
+
+    // Sort-wise canonicalization. Return true if value is modified.
+    // Only EqSort or containers of EqSort should override.
+    fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool {
+        #[cfg(debug_assertions)]
+        debug_assert_eq!(self.name(), value.tag);
+
+        #[cfg(not(debug_assertions))]
+        let _ = value;
+        let _ = unionfind;
+        false
+    }
+
+    /// Return the serialized name of the sort
+    ///
+    /// Only used for container sorts, which cannot be serialized with make_expr so need an explicit name
+    fn serialized_name(&self, _value: &Value) -> Symbol {
+        self.name()
+    }
+
+    /// Return the inner values and sorts.
+    /// Only eq_container_sort need to implement this method,
+    fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)> {
+        let _ = value;
+        vec![]
+    }
+
+    fn register_primitives(self: Arc<Self>, info: &mut TypeInfo) {
+        let _ = info;
+    }
+
+    /// Extracting an expression (with smallest cost) out of a primitive value
+    fn make_expr(&self, egraph: &EGraph, value: Value) -> (Cost, Expr);
+
+    /// For values like EqSort containers, to make/extract an expression from it
+    /// requires an extractor. Moreover, the extraction may be unsuccessful if
+    /// the extractor is not fully initialized.
+    ///
+    /// The default behavior is to call make_expr
+    fn extract_expr(
+        &self,
+        egraph: &EGraph,
+        value: Value,
+        _extractor: &Extractor,
+        _termdag: &mut TermDag,
+    ) -> Option<(Cost, Expr)> {
+        Some(self.make_expr(egraph, value))
+    }
+}
+
+// Note: this trait is currently intended to be implemented on the
+// same struct as `Sort`. If in the future we have dynamic presorts
+// (for example, we want to add partial application) we should revisit
+// this and make the methods take a `self` parameter.
+pub trait Presort {
+    fn presort_name() -> Symbol;
+    fn reserved_primitives() -> Vec<Symbol>;
+    fn make_sort(
+        typeinfo: &mut TypeInfo,
+        name: Symbol,
+        args: &[Expr],
+    ) -> Result<ArcSort, TypeError>;
+}
+
+#[derive(Debug)]
+pub struct EqSort {
+    pub name: Symbol,
+}
+
+impl Sort for EqSort {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static> {
+        self
+    }
+
+    fn is_eq_sort(&self) -> bool {
+        true
+    }
+
+    fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool {
+        #[cfg(debug_assertions)]
+        debug_assert_eq!(self.name(), value.tag);
+
+        let bits = unionfind.find(value.bits);
+        if bits != value.bits {
+            value.bits = bits;
+            true
+        } else {
+            false
+        }
+    }
+
+    fn make_expr(&self, _egraph: &EGraph, _value: Value) -> (Cost, Expr) {
+        unimplemented!("No make_expr for EqSort {}", self.name)
+    }
+}
+
+pub trait FromSort: Sized {
+    type Sort: Sort;
+    fn load(sort: &Self::Sort, value: &Value) -> Self;
+}
+
+pub trait IntoSort: Sized {
+    type Sort: Sort;
+    fn store(self, sort: &Self::Sort) -> Option<Value>;
+}
+
+impl<T: IntoSort> IntoSort for Option<T> {
+    type Sort = T::Sort;
+
+    fn store(self, sort: &Self::Sort) -> Option<Value> {
+        self?.store(sort)
+    }
+}
+
+pub type PreSort =
+    fn(typeinfo: &mut TypeInfo, name: Symbol, params: &[Expr]) -> Result<ArcSort, TypeError>;
+
+pub(crate) struct ValueEq;
+
+impl PrimitiveLike for ValueEq {
+    fn name(&self) -> Symbol {
+        "value-eq".into()
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        AllEqualTypeConstraint::new(self.name(), span.clone())
+            .with_exact_length(3)
+            .with_output_sort(Arc::new(UnitSort))
+            .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        assert_eq!(values.len(), 2);
+        if values[0] == values[1] {
+            Some(Value::unit())
+        } else {
+            None
+        }
+    }
+}
+
+pub fn literal_sort(lit: &Literal) -> ArcSort {
+    match lit {
+        Literal::Int(_) => Arc::new(I64Sort) as ArcSort,
+        Literal::F64(_) => Arc::new(F64Sort) as ArcSort,
+        Literal::String(_) => Arc::new(StringSort) as ArcSort,
+        Literal::Bool(_) => Arc::new(BoolSort) as ArcSort,
+        Literal::Unit => Arc::new(UnitSort) as ArcSort,
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/sort/multiset.rs.html b/docs/src/egglog/sort/multiset.rs.html new file mode 100644 index 00000000..416ef529 --- /dev/null +++ b/docs/src/egglog/sort/multiset.rs.html @@ -0,0 +1,1149 @@ +multiset.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+
use std::sync::Mutex;
+
+use inner::MultiSet;
+
+use super::*;
+use crate::constraint::{AllEqualTypeConstraint, SimpleTypeConstraint};
+
+// Place multiset in its own module to keep implementation details private from sort
+mod inner {
+    use im::OrdMap;
+    use std::hash::Hash;
+    /// Immutable multiset implementation, which is threadsafe and hash stable, regardless of insertion order.
+    ///
+    /// All methods that return a new multiset take ownership of the old multiset.
+    #[derive(Debug, Hash, Eq, PartialEq, Clone)]
+    pub(crate) struct MultiSet<T: Hash + Ord + Clone>(
+        /// All values should be > 0
+        OrdMap<T, usize>,
+        /// cached length
+        usize,
+    );
+
+    impl<T: Hash + Ord + Clone> MultiSet<T> {
+        /// Create a new empty multiset.
+        pub(crate) fn new() -> Self {
+            MultiSet(OrdMap::new(), 0)
+        }
+
+        /// Check if the multiset contains a key.
+        pub(crate) fn contains(&self, value: &T) -> bool {
+            self.0.contains_key(value)
+        }
+
+        /// Return the total number of elements in the multiset.
+        pub(crate) fn len(&self) -> usize {
+            self.1
+        }
+
+        /// Return an iterator over all elements in the multiset.
+        pub(crate) fn iter(&self) -> impl Iterator<Item = &T> {
+            self.0
+                .iter()
+                .flat_map(|(k, v)| std::iter::repeat(k).take(*v))
+        }
+
+        /// Return an arbitrary element from the multiset.
+        pub(crate) fn pick(&self) -> Option<&T> {
+            self.0.keys().next()
+        }
+
+        /// Map a function over all elements in the multiset, taking ownership of it and returning a new multiset.
+        pub(crate) fn map(self, mut f: impl FnMut(&T) -> T) -> MultiSet<T> {
+            let mut new = MultiSet::new();
+            for (k, v) in self.0.into_iter() {
+                new.insert_multiple_mut(f(&k), v);
+            }
+            new
+        }
+
+        /// Insert a value into the multiset, taking ownership of it and returning a new multiset.
+        pub(crate) fn insert(mut self, value: T) -> MultiSet<T> {
+            self.insert_multiple_mut(value, 1);
+            self
+        }
+
+        /// Remove a value from the multiset, taking ownership of it and returning a new multiset.
+        pub(crate) fn remove(mut self, value: &T) -> Option<MultiSet<T>> {
+            if let Some(v) = self.0.get(value) {
+                self.1 -= 1;
+                if *v == 1 {
+                    self.0.remove(value);
+                } else {
+                    self.0.insert(value.clone(), v - 1);
+                }
+                Some(self)
+            } else {
+                None
+            }
+        }
+
+        fn insert_multiple_mut(&mut self, value: T, n: usize) {
+            self.1 += n;
+            if let Some(v) = self.0.get(&value) {
+                self.0.insert(value, v + n);
+            } else {
+                self.0.insert(value, n);
+            }
+        }
+
+        /// Create a multiset from an iterator.
+        pub(crate) fn from_iter(iter: impl IntoIterator<Item = T>) -> Self {
+            let mut multiset = MultiSet::new();
+            for value in iter {
+                multiset.insert_multiple_mut(value, 1);
+            }
+            multiset
+        }
+    }
+}
+
+type ValueMultiSet = MultiSet<Value>;
+
+#[derive(Debug)]
+pub struct MultiSetSort {
+    name: Symbol,
+    element: ArcSort,
+    multisets: Mutex<IndexSet<ValueMultiSet>>,
+}
+
+impl MultiSetSort {
+    pub fn element(&self) -> ArcSort {
+        self.element.clone()
+    }
+
+    pub fn element_name(&self) -> Symbol {
+        self.element.name()
+    }
+}
+
+impl Presort for MultiSetSort {
+    fn presort_name() -> Symbol {
+        "MultiSet".into()
+    }
+
+    fn reserved_primitives() -> Vec<Symbol> {
+        vec![
+            "multiset-of".into(),
+            "multiset-insert".into(),
+            "multiset-contains".into(),
+            "multiset-not-contains".into(),
+            "multiset-remove".into(),
+            "multiset-length".into(),
+            "unstable-multiset-map".into(),
+        ]
+    }
+
+    fn make_sort(
+        typeinfo: &mut TypeInfo,
+        name: Symbol,
+        args: &[Expr],
+    ) -> Result<ArcSort, TypeError> {
+        if let [Expr::Var(span, e)] = args {
+            let e = typeinfo
+                .sorts
+                .get(e)
+                .ok_or(TypeError::UndefinedSort(*e, span.clone()))?;
+
+            if e.is_eq_container_sort() {
+                return Err(TypeError::DisallowedSort(
+                    name,
+                    "Multisets nested with other EqSort containers are not allowed".into(),
+                    span.clone(),
+                ));
+            }
+
+            Ok(Arc::new(Self {
+                name,
+                element: e.clone(),
+                multisets: Default::default(),
+            }))
+        } else {
+            panic!()
+        }
+    }
+}
+
+impl Sort for MultiSetSort {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static> {
+        self
+    }
+
+    fn is_container_sort(&self) -> bool {
+        true
+    }
+
+    fn is_eq_container_sort(&self) -> bool {
+        self.element.is_eq_sort()
+    }
+
+    fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)> {
+        let multisets = self.multisets.lock().unwrap();
+        let multiset = multisets.get_index(value.bits as usize).unwrap();
+        multiset
+            .iter()
+            .map(|k| (self.element.clone(), *k))
+            .collect()
+    }
+
+    fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool {
+        let multisets = self.multisets.lock().unwrap();
+        let multiset = multisets.get_index(value.bits as usize).unwrap().clone();
+        let mut changed = false;
+        let new_multiset = multiset.map(|e| {
+            let mut e = *e;
+            changed |= self.element.canonicalize(&mut e, unionfind);
+            e
+        });
+        drop(multisets);
+        *value = new_multiset.store(self).unwrap();
+        changed
+    }
+
+    fn register_primitives(self: Arc<Self>, typeinfo: &mut TypeInfo) {
+        typeinfo.add_primitive(MultiSetOf {
+            name: "multiset-of".into(),
+            multiset: self.clone(),
+        });
+        typeinfo.add_primitive(Insert {
+            name: "multiset-insert".into(),
+            multiset: self.clone(),
+        });
+        typeinfo.add_primitive(Contains {
+            name: "multiset-contains".into(),
+            multiset: self.clone(),
+        });
+        typeinfo.add_primitive(NotContains {
+            name: "multiset-not-contains".into(),
+            multiset: self.clone(),
+        });
+        typeinfo.add_primitive(Remove {
+            name: "multiset-remove".into(),
+            multiset: self.clone(),
+        });
+        typeinfo.add_primitive(Length {
+            name: "multiset-length".into(),
+            multiset: self.clone(),
+        });
+        typeinfo.add_primitive(Pick {
+            name: "multiset-pick".into(),
+            multiset: self.clone(),
+        });
+        let inner_name = self.element.name();
+        let fn_sort = typeinfo.get_sort_by(|s: &Arc<FunctionSort>| {
+            (s.output.name() == inner_name)
+                && s.inputs.len() == 1
+                && (s.inputs[0].name() == inner_name)
+        });
+        // Only include map function if we already declared a function sort with the correct signature
+        if let Some(fn_sort) = fn_sort {
+            typeinfo.add_primitive(Map {
+                name: "unstable-multiset-map".into(),
+                multiset: self.clone(),
+                fn_: fn_sort,
+            });
+        }
+    }
+
+    fn make_expr(&self, egraph: &EGraph, value: Value) -> (Cost, Expr) {
+        let mut termdag = TermDag::default();
+        let extractor = Extractor::new(egraph, &mut termdag);
+        self.extract_expr(egraph, value, &extractor, &mut termdag)
+            .expect("Extraction should be successful since extractor has been fully initialized")
+    }
+
+    fn extract_expr(
+        &self,
+        _egraph: &EGraph,
+        value: Value,
+        extractor: &Extractor,
+        termdag: &mut TermDag,
+    ) -> Option<(Cost, Expr)> {
+        let multiset = ValueMultiSet::load(self, &value);
+        let mut children = vec![];
+        let mut cost = 0usize;
+        for e in multiset.iter() {
+            let (child_cost, child_term) = extractor.find_best(*e, termdag, &self.element)?;
+            cost = cost.saturating_add(child_cost);
+            children.push(termdag.term_to_expr(&child_term));
+        }
+        let expr = Expr::call_no_span("multiset-of", children);
+        Some((cost, expr))
+    }
+
+    fn serialized_name(&self, _value: &Value) -> Symbol {
+        "multiset-of".into()
+    }
+}
+
+impl IntoSort for ValueMultiSet {
+    type Sort = MultiSetSort;
+    fn store(self, sort: &Self::Sort) -> Option<Value> {
+        let mut multisets = sort.multisets.lock().unwrap();
+        let (i, _) = multisets.insert_full(self);
+        Some(Value {
+            #[cfg(debug_assertions)]
+            tag: sort.name,
+            bits: i as u64,
+        })
+    }
+}
+
+impl FromSort for ValueMultiSet {
+    type Sort = MultiSetSort;
+    fn load(sort: &Self::Sort, value: &Value) -> Self {
+        let sets = sort.multisets.lock().unwrap();
+        sets.get_index(value.bits as usize).unwrap().clone()
+    }
+}
+
+struct MultiSetOf {
+    name: Symbol,
+    multiset: Arc<MultiSetSort>,
+}
+
+impl PrimitiveLike for MultiSetOf {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        AllEqualTypeConstraint::new(self.name(), span.clone())
+            .with_all_arguments_sort(self.multiset.element())
+            .with_output_sort(self.multiset.clone())
+            .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let multiset = MultiSet::from_iter(values.iter().copied());
+        Some(multiset.store(&self.multiset).unwrap())
+    }
+}
+
+struct Insert {
+    name: Symbol,
+    multiset: Arc<MultiSetSort>,
+}
+
+impl PrimitiveLike for Insert {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![
+                self.multiset.clone(),
+                self.multiset.element(),
+                self.multiset.clone(),
+            ],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let multiset = ValueMultiSet::load(&self.multiset, &values[0]);
+        let multiset = multiset.insert(values[1]);
+        multiset.store(&self.multiset)
+    }
+}
+
+struct Contains {
+    name: Symbol,
+    multiset: Arc<MultiSetSort>,
+}
+
+impl PrimitiveLike for Contains {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![
+                self.multiset.clone(),
+                self.multiset.element(),
+                Arc::new(UnitSort),
+            ],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let multiset = ValueMultiSet::load(&self.multiset, &values[0]);
+        if multiset.contains(&values[1]) {
+            Some(Value::unit())
+        } else {
+            None
+        }
+    }
+}
+
+struct NotContains {
+    name: Symbol,
+    multiset: Arc<MultiSetSort>,
+}
+
+impl PrimitiveLike for NotContains {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![
+                self.multiset.clone(),
+                self.multiset.element(),
+                Arc::new(UnitSort),
+            ],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let multiset = ValueMultiSet::load(&self.multiset, &values[0]);
+        if !multiset.contains(&values[1]) {
+            Some(Value::unit())
+        } else {
+            None
+        }
+    }
+}
+
+struct Length {
+    name: Symbol,
+    multiset: Arc<MultiSetSort>,
+}
+
+impl PrimitiveLike for Length {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.multiset.clone(), Arc::new(I64Sort)],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let multiset = ValueMultiSet::load(&self.multiset, &values[0]);
+        Some(Value::from(multiset.len() as i64))
+    }
+}
+
+struct Remove {
+    name: Symbol,
+    multiset: Arc<MultiSetSort>,
+}
+
+impl PrimitiveLike for Remove {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![
+                self.multiset.clone(),
+                self.multiset.element(),
+                self.multiset.clone(),
+            ],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let multiset = ValueMultiSet::load(&self.multiset, &values[0]);
+        let multiset = multiset.remove(&values[1]);
+        multiset.store(&self.multiset)
+    }
+}
+
+struct Pick {
+    name: Symbol,
+    multiset: Arc<MultiSetSort>,
+}
+
+impl PrimitiveLike for Pick {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.multiset.clone(), self.multiset.element()],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let multiset = ValueMultiSet::load(&self.multiset, &values[0]);
+        Some(*multiset.pick().expect("Cannot pick from an empty multiset"))
+    }
+}
+
+struct Map {
+    name: Symbol,
+    multiset: Arc<MultiSetSort>,
+    fn_: Arc<FunctionSort>,
+}
+
+impl PrimitiveLike for Map {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![
+                self.fn_.clone(),
+                self.multiset.clone(),
+                self.multiset.clone(),
+            ],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let egraph =
+            egraph.unwrap_or_else(|| panic!("`{}` is not supported yet in facts.", self.name));
+        let multiset = ValueMultiSet::load(&self.multiset, &values[1]);
+        let new_multiset = multiset.map(|e| self.fn_.apply(&values[0], &[*e], egraph));
+        new_multiset.store(&self.multiset)
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/sort/rational.rs.html b/docs/src/egglog/sort/rational.rs.html new file mode 100644 index 00000000..6202292b --- /dev/null +++ b/docs/src/egglog/sort/rational.rs.html @@ -0,0 +1,289 @@ +rational.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+
use num::integer::Roots;
+use num::traits::{CheckedAdd, CheckedDiv, CheckedMul, CheckedSub, One, Signed, ToPrimitive, Zero};
+use std::sync::Mutex;
+
+type R = num::rational::Rational64;
+use crate::{ast::Literal, util::IndexSet};
+
+use super::*;
+
+lazy_static! {
+    static ref RATIONAL_SORT_NAME: Symbol = "Rational".into();
+    static ref RATS: Mutex<IndexSet<R>> = Default::default();
+}
+
+#[derive(Debug)]
+pub struct RationalSort;
+
+impl Sort for RationalSort {
+    fn name(&self) -> Symbol {
+        *RATIONAL_SORT_NAME
+    }
+
+    fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static> {
+        self
+    }
+
+    #[rustfmt::skip]
+    fn register_primitives(self: Arc<Self>, eg: &mut TypeInfo) {
+        type Opt<T=()> = Option<T>;
+
+        // TODO we can't have primitives take borrows just yet, since it
+        // requires returning a reference to the locked sort
+        add_primitives!(eg, "+" = |a: R, b: R| -> Opt<R> { a.checked_add(&b) });
+        add_primitives!(eg, "-" = |a: R, b: R| -> Opt<R> { a.checked_sub(&b) });
+        add_primitives!(eg, "*" = |a: R, b: R| -> Opt<R> { a.checked_mul(&b) });
+        add_primitives!(eg, "/" = |a: R, b: R| -> Opt<R> { a.checked_div(&b) });
+
+        add_primitives!(eg, "min" = |a: R, b: R| -> R { a.min(b) });
+        add_primitives!(eg, "max" = |a: R, b: R| -> R { a.max(b) });
+        add_primitives!(eg, "neg" = |a: R| -> R { -a });
+        add_primitives!(eg, "abs" = |a: R| -> R { a.abs() });
+        add_primitives!(eg, "floor" = |a: R| -> R { a.floor() });
+        add_primitives!(eg, "ceil" = |a: R| -> R { a.ceil() });
+        add_primitives!(eg, "round" = |a: R| -> R { a.round() });
+        add_primitives!(eg, "rational" = |a: i64, b: i64| -> R { R::new(a, b) });
+        add_primitives!(eg, "numer" = |a: R| -> i64 { *a.numer() });
+        add_primitives!(eg, "denom" = |a: R| -> i64 { *a.denom() });
+
+        add_primitives!(eg, "to-f64" = |a: R| -> f64 { a.to_f64().unwrap() });
+
+        add_primitives!(eg, "pow" = |a: R, b: R| -> Option<R> {
+            if a.is_zero() {
+                if b.is_positive() {
+                    Some(R::zero())
+                } else {
+                    None
+                }
+            } else if b.is_zero() {
+                Some(R::one())
+            } else if let Some(b) = b.to_i64() {
+                if let Ok(b) = usize::try_from(b) {
+                    num::traits::checked_pow(a, b)
+                } else {
+                    // TODO handle negative powers
+                    None
+                }
+            } else {
+                None
+            }
+        });
+        add_primitives!(eg, "log" = |a: R| -> Option<R> {
+            if a.is_one() {
+                Some(R::zero())
+            } else {
+                todo!()
+            }
+        });
+        add_primitives!(eg, "sqrt" = |a: R| -> Option<R> {
+            if a.numer().is_positive() && a.denom().is_positive() {
+                let s1 = a.numer().sqrt();
+                let s2 = a.denom().sqrt();
+                let is_perfect = &(s1 * s1) == a.numer() && &(s2 * s2) == a.denom();
+                if is_perfect {
+                    Some(R::new(s1, s2))
+                } else {
+                    None
+                }
+            } else {
+                None
+            }
+        });
+        add_primitives!(eg, "cbrt" = |a: R| -> Option<R> {
+            if a.is_one() {
+                Some(R::one())
+            } else {
+                todo!()
+            }
+        });
+
+        add_primitives!(eg, "<" = |a: R, b: R| -> Opt { if a < b {Some(())} else {None} });
+        add_primitives!(eg, ">" = |a: R, b: R| -> Opt { if a > b {Some(())} else {None} });
+        add_primitives!(eg, "<=" = |a: R, b: R| -> Opt { if a <= b {Some(())} else {None} });
+        add_primitives!(eg, ">=" = |a: R, b: R| -> Opt { if a >= b {Some(())} else {None} });
+   }
+
+    fn make_expr(&self, _egraph: &EGraph, value: Value) -> (Cost, Expr) {
+        #[cfg(debug_assertions)]
+        debug_assert_eq!(value.tag, self.name());
+
+        let rat = R::load(self, &value);
+        let numer = *rat.numer();
+        let denom = *rat.denom();
+        (
+            1,
+            Expr::call_no_span(
+                "rational",
+                vec![
+                    GenericExpr::Lit(DUMMY_SPAN.clone(), Literal::Int(numer)),
+                    GenericExpr::Lit(DUMMY_SPAN.clone(), Literal::Int(denom)),
+                ],
+            ),
+        )
+    }
+}
+
+impl FromSort for R {
+    type Sort = RationalSort;
+    fn load(_sort: &Self::Sort, value: &Value) -> Self {
+        let i = value.bits as usize;
+        *RATS.lock().unwrap().get_index(i).unwrap()
+    }
+}
+
+impl IntoSort for R {
+    type Sort = RationalSort;
+    fn store(self, _sort: &Self::Sort) -> Option<Value> {
+        let (i, _) = RATS.lock().unwrap().insert_full(self);
+        Some(Value {
+            #[cfg(debug_assertions)]
+            tag: RationalSort.name(),
+            bits: i as u64,
+        })
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/sort/set.rs.html b/docs/src/egglog/sort/set.rs.html new file mode 100644 index 00000000..98149ef8 --- /dev/null +++ b/docs/src/egglog/sort/set.rs.html @@ -0,0 +1,1203 @@ +set.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+
use std::collections::BTreeSet;
+use std::sync::Mutex;
+
+use crate::constraint::{AllEqualTypeConstraint, SimpleTypeConstraint};
+
+use super::*;
+
+type ValueSet = BTreeSet<Value>;
+
+#[derive(Debug)]
+pub struct SetSort {
+    name: Symbol,
+    element: ArcSort,
+    sets: Mutex<IndexSet<ValueSet>>,
+}
+
+impl SetSort {
+    pub fn element(&self) -> ArcSort {
+        self.element.clone()
+    }
+
+    pub fn element_name(&self) -> Symbol {
+        self.element.name()
+    }
+}
+
+impl Presort for SetSort {
+    fn presort_name() -> Symbol {
+        "Set".into()
+    }
+
+    fn reserved_primitives() -> Vec<Symbol> {
+        vec![
+            "set-of".into(),
+            "set-empty".into(),
+            "set-insert".into(),
+            "set-not-contains".into(),
+            "set-contains".into(),
+            "set-remove".into(),
+            "set-union".into(),
+            "set-diff".into(),
+            "set-intersect".into(),
+            "set-get".into(),
+            "set-length".into(),
+        ]
+    }
+
+    fn make_sort(
+        typeinfo: &mut TypeInfo,
+        name: Symbol,
+        args: &[Expr],
+    ) -> Result<ArcSort, TypeError> {
+        if let [Expr::Var(span, e)] = args {
+            let e = typeinfo
+                .sorts
+                .get(e)
+                .ok_or(TypeError::UndefinedSort(*e, span.clone()))?;
+
+            if e.is_eq_container_sort() {
+                return Err(TypeError::DisallowedSort(
+                    name,
+                    "Sets nested with other EqSort containers are not allowed".into(),
+                    span.clone(),
+                ));
+            }
+
+            Ok(Arc::new(Self {
+                name,
+                element: e.clone(),
+                sets: Default::default(),
+            }))
+        } else {
+            panic!()
+        }
+    }
+}
+
+impl Sort for SetSort {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static> {
+        self
+    }
+
+    fn is_container_sort(&self) -> bool {
+        true
+    }
+
+    fn is_eq_container_sort(&self) -> bool {
+        self.element.is_eq_sort()
+    }
+
+    fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)> {
+        // TODO: Potential duplication of code
+        let sets = self.sets.lock().unwrap();
+        let set = sets.get_index(value.bits as usize).unwrap();
+        let mut result = Vec::new();
+        for e in set.iter() {
+            result.push((self.element.clone(), *e));
+        }
+        result
+    }
+
+    fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool {
+        let sets = self.sets.lock().unwrap();
+        let set = sets.get_index(value.bits as usize).unwrap();
+        let mut changed = false;
+        let new_set: ValueSet = set
+            .iter()
+            .map(|e| {
+                let mut e = *e;
+                changed |= self.element.canonicalize(&mut e, unionfind);
+                e
+            })
+            .collect();
+        drop(sets);
+        *value = new_set.store(self).unwrap();
+        changed
+    }
+
+    fn register_primitives(self: Arc<Self>, typeinfo: &mut TypeInfo) {
+        typeinfo.add_primitive(SetRebuild {
+            name: "rebuild".into(),
+            set: self.clone(),
+        });
+        typeinfo.add_primitive(SetOf {
+            name: "set-of".into(),
+            set: self.clone(),
+        });
+        typeinfo.add_primitive(Ctor {
+            name: "set-empty".into(),
+            set: self.clone(),
+        });
+        typeinfo.add_primitive(Insert {
+            name: "set-insert".into(),
+            set: self.clone(),
+        });
+        typeinfo.add_primitive(NotContains {
+            name: "set-not-contains".into(),
+            set: self.clone(),
+        });
+        typeinfo.add_primitive(Contains {
+            name: "set-contains".into(),
+            set: self.clone(),
+        });
+        typeinfo.add_primitive(Remove {
+            name: "set-remove".into(),
+            set: self.clone(),
+        });
+        typeinfo.add_primitive(Get {
+            name: "set-get".into(),
+            set: self.clone(),
+        });
+        typeinfo.add_primitive(Length {
+            name: "set-length".into(),
+            set: self.clone(),
+        });
+        typeinfo.add_primitive(Union {
+            name: "set-union".into(),
+            set: self.clone(),
+        });
+        typeinfo.add_primitive(Diff {
+            name: "set-diff".into(),
+            set: self.clone(),
+        });
+        typeinfo.add_primitive(Intersect {
+            name: "set-intersect".into(),
+            set: self,
+        });
+    }
+
+    fn make_expr(&self, egraph: &EGraph, value: Value) -> (Cost, Expr) {
+        let mut termdag = TermDag::default();
+        let extractor = Extractor::new(egraph, &mut termdag);
+        self.extract_expr(egraph, value, &extractor, &mut termdag)
+            .expect("Extraction should be successful since extractor has been fully initialized")
+    }
+
+    fn extract_expr(
+        &self,
+        _egraph: &EGraph,
+        value: Value,
+        extractor: &Extractor,
+        termdag: &mut TermDag,
+    ) -> Option<(Cost, Expr)> {
+        let set = ValueSet::load(self, &value);
+        let mut expr = Expr::call_no_span("set-empty", []);
+        let mut cost = 0usize;
+        for e in set.iter().rev() {
+            let e = extractor.find_best(*e, termdag, &self.element)?;
+            cost = cost.saturating_add(e.0);
+            expr = Expr::call_no_span("set-insert", [expr, termdag.term_to_expr(&e.1)])
+        }
+        Some((cost, expr))
+    }
+
+    fn serialized_name(&self, _value: &Value) -> Symbol {
+        "set-of".into()
+    }
+}
+
+impl IntoSort for ValueSet {
+    type Sort = SetSort;
+    fn store(self, sort: &Self::Sort) -> Option<Value> {
+        let mut sets = sort.sets.lock().unwrap();
+        let (i, _) = sets.insert_full(self);
+        Some(Value {
+            #[cfg(debug_assertions)]
+            tag: sort.name,
+            bits: i as u64,
+        })
+    }
+}
+
+impl FromSort for ValueSet {
+    type Sort = SetSort;
+    fn load(sort: &Self::Sort, value: &Value) -> Self {
+        let sets = sort.sets.lock().unwrap();
+        sets.get_index(value.bits as usize).unwrap().clone()
+    }
+}
+
+struct SetOf {
+    name: Symbol,
+    set: Arc<SetSort>,
+}
+
+impl PrimitiveLike for SetOf {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        AllEqualTypeConstraint::new(self.name(), span.clone())
+            .with_all_arguments_sort(self.set.element())
+            .with_output_sort(self.set.clone())
+            .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let set = ValueSet::from_iter(values.iter().copied());
+        Some(set.store(&self.set).unwrap())
+    }
+}
+
+struct Ctor {
+    name: Symbol,
+    set: Arc<SetSort>,
+}
+
+impl PrimitiveLike for Ctor {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(self.name(), vec![self.set.clone()], span.clone()).into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        assert!(values.is_empty());
+        ValueSet::default().store(&self.set)
+    }
+}
+
+struct SetRebuild {
+    name: Symbol,
+    set: Arc<SetSort>,
+}
+
+impl PrimitiveLike for SetRebuild {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.set.clone(), self.set.clone()],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let egraph = egraph.unwrap();
+        let set = ValueSet::load(&self.set, &values[0]);
+        let new_set: ValueSet = set
+            .iter()
+            .map(|e| egraph.find(&self.set.element, *e))
+            .collect();
+        // drop set to make sure we lose lock
+        drop(set);
+        new_set.store(&self.set)
+    }
+}
+
+struct Insert {
+    name: Symbol,
+    set: Arc<SetSort>,
+}
+
+impl PrimitiveLike for Insert {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.set.clone(), self.set.element(), self.set.clone()],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let mut set = ValueSet::load(&self.set, &values[0]);
+        set.insert(values[1]);
+        set.store(&self.set)
+    }
+}
+
+struct NotContains {
+    name: Symbol,
+    set: Arc<SetSort>,
+}
+
+impl PrimitiveLike for NotContains {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.set.clone(), self.set.element(), Arc::new(UnitSort)],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let set = ValueSet::load(&self.set, &values[0]);
+        if set.contains(&values[1]) {
+            None
+        } else {
+            Some(Value::unit())
+        }
+    }
+}
+
+struct Contains {
+    name: Symbol,
+    set: Arc<SetSort>,
+}
+
+impl PrimitiveLike for Contains {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.set.clone(), self.set.element(), Arc::new(UnitSort)],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let set = ValueSet::load(&self.set, &values[0]);
+        if set.contains(&values[1]) {
+            Some(Value::unit())
+        } else {
+            None
+        }
+    }
+}
+
+struct Union {
+    name: Symbol,
+    set: Arc<SetSort>,
+}
+
+impl PrimitiveLike for Union {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.set.clone(), self.set.clone(), self.set.clone()],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let mut set1 = ValueSet::load(&self.set, &values[0]);
+        let set2 = ValueSet::load(&self.set, &values[1]);
+        set1.extend(set2.iter());
+        set1.store(&self.set)
+    }
+}
+
+struct Intersect {
+    name: Symbol,
+    set: Arc<SetSort>,
+}
+
+impl PrimitiveLike for Intersect {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.set.clone(), self.set.clone(), self.set.clone()],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let mut set1 = ValueSet::load(&self.set, &values[0]);
+        let set2 = ValueSet::load(&self.set, &values[1]);
+        set1.retain(|k| set2.contains(k));
+        // set.insert(values[1], values[2]);
+        set1.store(&self.set)
+    }
+}
+
+struct Length {
+    name: Symbol,
+    set: Arc<SetSort>,
+}
+
+impl PrimitiveLike for Length {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.set.clone(), Arc::new(I64Sort)],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let set = ValueSet::load(&self.set, &values[0]);
+        Some(Value::from(set.len() as i64))
+    }
+}
+
+struct Get {
+    name: Symbol,
+    set: Arc<SetSort>,
+}
+
+impl PrimitiveLike for Get {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.set.clone(), Arc::new(I64Sort), self.set.element()],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let set = ValueSet::load(&self.set, &values[0]);
+        let index = i64::load(&I64Sort, &values[1]);
+        set.iter().nth(index as usize).copied()
+    }
+}
+
+struct Remove {
+    name: Symbol,
+    set: Arc<SetSort>,
+}
+
+impl PrimitiveLike for Remove {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.set.clone(), self.set.element(), self.set.clone()],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let mut set = ValueSet::load(&self.set, &values[0]);
+        set.remove(&values[1]);
+        set.store(&self.set)
+    }
+}
+
+struct Diff {
+    name: Symbol,
+    set: Arc<SetSort>,
+}
+
+impl PrimitiveLike for Diff {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.set.clone(), self.set.clone(), self.set.clone()],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let mut set1 = ValueSet::load(&self.set, &values[0]);
+        let set2 = ValueSet::load(&self.set, &values[1]);
+        set1.retain(|k| !set2.contains(k));
+        set1.store(&self.set)
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/sort/string.rs.html b/docs/src/egglog/sort/string.rs.html new file mode 100644 index 00000000..c3f1700d --- /dev/null +++ b/docs/src/egglog/sort/string.rs.html @@ -0,0 +1,255 @@ +string.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+
use std::num::NonZeroU32;
+
+use crate::{ast::Literal, constraint::AllEqualTypeConstraint};
+
+use super::*;
+
+#[derive(Debug)]
+pub struct StringSort;
+
+lazy_static! {
+    static ref STRING_SORT_NAME: Symbol = "String".into();
+}
+
+impl Sort for StringSort {
+    fn name(&self) -> Symbol {
+        *STRING_SORT_NAME
+    }
+
+    fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static> {
+        self
+    }
+
+    fn make_expr(&self, _egraph: &EGraph, value: Value) -> (Cost, Expr) {
+        #[cfg(debug_assertions)]
+        debug_assert_eq!(value.tag, self.name());
+
+        let sym = Symbol::from(NonZeroU32::new(value.bits as _).unwrap());
+        (
+            1,
+            GenericExpr::Lit(DUMMY_SPAN.clone(), Literal::String(sym)),
+        )
+    }
+
+    fn register_primitives(self: Arc<Self>, typeinfo: &mut TypeInfo) {
+        typeinfo.add_primitive(Add {
+            name: "+".into(),
+            string: self.clone(),
+        });
+        typeinfo.add_primitive(Replace {
+            name: "replace".into(),
+            string: self,
+        });
+    }
+}
+
+// TODO could use a local symbol table
+
+impl IntoSort for Symbol {
+    type Sort = StringSort;
+    fn store(self, _sort: &Self::Sort) -> Option<Value> {
+        Some(Value {
+            #[cfg(debug_assertions)]
+            tag: StringSort.name(),
+            bits: NonZeroU32::from(self).get() as _,
+        })
+    }
+}
+
+impl FromSort for Symbol {
+    type Sort = StringSort;
+    fn load(_sort: &Self::Sort, value: &Value) -> Self {
+        NonZeroU32::new(value.bits as u32).unwrap().into()
+    }
+}
+
+struct Add {
+    name: Symbol,
+    string: Arc<StringSort>,
+}
+
+impl PrimitiveLike for Add {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        AllEqualTypeConstraint::new(self.name(), span.clone())
+            .with_all_arguments_sort(self.string.clone())
+            .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let mut res_string: String = "".to_owned();
+        for value in values {
+            let sym = Symbol::load(&self.string, value);
+            res_string.push_str(sym.as_str());
+        }
+        let res_symbol: Symbol = res_string.into();
+        Some(Value::from(res_symbol))
+    }
+}
+
+struct Replace {
+    name: Symbol,
+    string: Arc<StringSort>,
+}
+
+impl PrimitiveLike for Replace {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        AllEqualTypeConstraint::new(self.name(), span.clone())
+            .with_all_arguments_sort(self.string.clone())
+            .with_exact_length(4)
+            .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let string1 = Symbol::load(&self.string, &values[0]).to_string();
+        let string2 = Symbol::load(&self.string, &values[1]).to_string();
+        let string3 = Symbol::load(&self.string, &values[2]).to_string();
+        let res: Symbol = string1.replace(&string2, &string3).into();
+        Some(Value::from(res))
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/sort/unit.rs.html b/docs/src/egglog/sort/unit.rs.html new file mode 100644 index 00000000..9ebb0f04 --- /dev/null +++ b/docs/src/egglog/sort/unit.rs.html @@ -0,0 +1,135 @@ +unit.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+
use super::*;
+use crate::{ast::Literal, constraint::AllEqualTypeConstraint, ArcSort, PrimitiveLike};
+
+#[derive(Debug)]
+pub struct UnitSort;
+
+lazy_static! {
+    static ref UNIT_SORT_NAME: Symbol = "Unit".into();
+}
+
+impl Sort for UnitSort {
+    fn name(&self) -> Symbol {
+        *UNIT_SORT_NAME
+    }
+
+    fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static> {
+        self
+    }
+
+    fn register_primitives(self: Arc<Self>, type_info: &mut TypeInfo) {
+        type_info.add_primitive(NotEqualPrimitive { unit: self })
+    }
+
+    fn make_expr(&self, _egraph: &EGraph, value: Value) -> (Cost, Expr) {
+        #[cfg(debug_assertions)]
+        debug_assert_eq!(value.tag, self.name());
+
+        #[cfg(not(debug_assertions))]
+        let _ = value;
+
+        (1, GenericExpr::Lit(DUMMY_SPAN.clone(), Literal::Unit))
+    }
+}
+
+impl IntoSort for () {
+    type Sort = UnitSort;
+
+    fn store(self, _sort: &Self::Sort) -> Option<Value> {
+        Some(Value::unit())
+    }
+}
+
+pub struct NotEqualPrimitive {
+    unit: ArcSort,
+}
+
+impl PrimitiveLike for NotEqualPrimitive {
+    fn name(&self) -> Symbol {
+        "!=".into()
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        AllEqualTypeConstraint::new(self.name(), span.clone())
+            .with_exact_length(3)
+            .with_output_sort(self.unit.clone())
+            .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        (values[0] != values[1]).then(Value::unit)
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/sort/vec.rs.html b/docs/src/egglog/sort/vec.rs.html new file mode 100644 index 00000000..790ef41a --- /dev/null +++ b/docs/src/egglog/sort/vec.rs.html @@ -0,0 +1,1283 @@ +vec.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+
use std::sync::Mutex;
+
+use crate::constraint::AllEqualTypeConstraint;
+
+use super::*;
+
+type ValueVec = Vec<Value>;
+
+#[derive(Debug)]
+pub struct VecSort {
+    name: Symbol,
+    element: ArcSort,
+    vecs: Mutex<IndexSet<ValueVec>>,
+}
+
+impl VecSort {
+    pub fn element(&self) -> ArcSort {
+        self.element.clone()
+    }
+
+    pub fn element_name(&self) -> Symbol {
+        self.element.name()
+    }
+}
+
+impl Presort for VecSort {
+    fn presort_name() -> Symbol {
+        "Vec".into()
+    }
+
+    fn reserved_primitives() -> Vec<Symbol> {
+        vec![
+            "vec-of".into(),
+            "vec-append".into(),
+            "vec-empty".into(),
+            "vec-push".into(),
+            "vec-pop".into(),
+            "vec-not-contains".into(),
+            "vec-contains".into(),
+            "vec-length".into(),
+            "vec-get".into(),
+            "vec-set".into(),
+            "vec-remove".into(),
+        ]
+    }
+
+    fn make_sort(
+        typeinfo: &mut TypeInfo,
+        name: Symbol,
+        args: &[Expr],
+    ) -> Result<ArcSort, TypeError> {
+        if let [Expr::Var(span, e)] = args {
+            let e = typeinfo
+                .sorts
+                .get(e)
+                .ok_or(TypeError::UndefinedSort(*e, span.clone()))?;
+
+            if e.is_eq_container_sort() {
+                return Err(TypeError::DisallowedSort(
+                    name,
+                    "Sets nested with other EqSort containers are not allowed".into(),
+                    span.clone(),
+                ));
+            }
+
+            Ok(Arc::new(Self {
+                name,
+                element: e.clone(),
+                vecs: Default::default(),
+            }))
+        } else {
+            panic!("Vec sort must have sort as argument. Got {:?}", args)
+        }
+    }
+}
+
+impl Sort for VecSort {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn as_arc_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static> {
+        self
+    }
+
+    fn is_container_sort(&self) -> bool {
+        true
+    }
+
+    fn is_eq_container_sort(&self) -> bool {
+        self.element.is_eq_sort()
+    }
+
+    fn inner_values(&self, value: &Value) -> Vec<(ArcSort, Value)> {
+        // TODO: Potential duplication of code
+        let vecs = self.vecs.lock().unwrap();
+        let vec = vecs.get_index(value.bits as usize).unwrap();
+        let mut result = Vec::new();
+        for e in vec.iter() {
+            result.push((self.element.clone(), *e));
+        }
+        result
+    }
+
+    fn canonicalize(&self, value: &mut Value, unionfind: &UnionFind) -> bool {
+        let vecs = self.vecs.lock().unwrap();
+        let vec = vecs.get_index(value.bits as usize).unwrap();
+        let mut changed = false;
+        let new_vec: ValueVec = vec
+            .iter()
+            .map(|e| {
+                let mut e = *e;
+                changed |= self.element.canonicalize(&mut e, unionfind);
+                e
+            })
+            .collect();
+        drop(vecs);
+        *value = new_vec.store(self).unwrap();
+        changed
+    }
+
+    fn register_primitives(self: Arc<Self>, typeinfo: &mut TypeInfo) {
+        typeinfo.add_primitive(VecRebuild {
+            name: "rebuild".into(),
+            vec: self.clone(),
+        });
+        typeinfo.add_primitive(VecOf {
+            name: "vec-of".into(),
+            vec: self.clone(),
+        });
+        typeinfo.add_primitive(Append {
+            name: "vec-append".into(),
+            vec: self.clone(),
+        });
+        typeinfo.add_primitive(Ctor {
+            name: "vec-empty".into(),
+            vec: self.clone(),
+        });
+        typeinfo.add_primitive(Push {
+            name: "vec-push".into(),
+            vec: self.clone(),
+        });
+        typeinfo.add_primitive(Pop {
+            name: "vec-pop".into(),
+            vec: self.clone(),
+        });
+        typeinfo.add_primitive(NotContains {
+            name: "vec-not-contains".into(),
+            vec: self.clone(),
+        });
+        typeinfo.add_primitive(Contains {
+            name: "vec-contains".into(),
+            vec: self.clone(),
+        });
+        typeinfo.add_primitive(Length {
+            name: "vec-length".into(),
+            vec: self.clone(),
+        });
+        typeinfo.add_primitive(Get {
+            name: "vec-get".into(),
+            vec: self.clone(),
+        });
+        typeinfo.add_primitive(Set {
+            name: "vec-set".into(),
+            vec: self.clone(),
+        });
+        typeinfo.add_primitive(Remove {
+            name: "vec-remove".into(),
+            vec: self,
+        })
+    }
+
+    fn make_expr(&self, egraph: &EGraph, value: Value) -> (Cost, Expr) {
+        let mut termdag = TermDag::default();
+        let extractor = Extractor::new(egraph, &mut termdag);
+        self.extract_expr(egraph, value, &extractor, &mut termdag)
+            .expect("Extraction should be successful since extractor has been fully initialized")
+    }
+
+    fn extract_expr(
+        &self,
+        _egraph: &EGraph,
+        value: Value,
+        extractor: &Extractor,
+        termdag: &mut TermDag,
+    ) -> Option<(Cost, Expr)> {
+        let vec = ValueVec::load(self, &value);
+        let mut cost = 0usize;
+
+        if vec.is_empty() {
+            Some((cost, Expr::call_no_span("vec-empty", [])))
+        } else {
+            let elems = vec
+                .into_iter()
+                .map(|e| {
+                    let e = extractor.find_best(e, termdag, &self.element)?;
+                    cost = cost.saturating_add(e.0);
+                    Some(termdag.term_to_expr(&e.1))
+                })
+                .collect::<Option<Vec<_>>>()?;
+
+            Some((cost, Expr::call_no_span("vec-of", elems)))
+        }
+    }
+
+    fn serialized_name(&self, _value: &Value) -> Symbol {
+        "vec-of".into()
+    }
+}
+
+impl IntoSort for ValueVec {
+    type Sort = VecSort;
+    fn store(self, sort: &Self::Sort) -> Option<Value> {
+        let mut vecs = sort.vecs.lock().unwrap();
+        let (i, _) = vecs.insert_full(self);
+        Some(Value {
+            #[cfg(debug_assertions)]
+            tag: sort.name,
+            bits: i as u64,
+        })
+    }
+}
+
+impl FromSort for ValueVec {
+    type Sort = VecSort;
+    fn load(sort: &Self::Sort, value: &Value) -> Self {
+        let vecs = sort.vecs.lock().unwrap();
+        vecs.get_index(value.bits as usize).unwrap().clone()
+    }
+}
+
+struct VecRebuild {
+    name: Symbol,
+    vec: Arc<VecSort>,
+}
+
+impl PrimitiveLike for VecRebuild {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.vec.clone(), self.vec.clone()],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let egraph = egraph.unwrap();
+        let vec = ValueVec::load(&self.vec, &values[0]);
+        let new_vec: ValueVec = vec
+            .iter()
+            .map(|e| egraph.find(&self.vec.element, *e))
+            .collect();
+        drop(vec);
+        Some(new_vec.store(&self.vec).unwrap())
+    }
+}
+struct VecOf {
+    name: Symbol,
+    vec: Arc<VecSort>,
+}
+
+impl PrimitiveLike for VecOf {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        AllEqualTypeConstraint::new(self.name(), span.clone())
+            .with_all_arguments_sort(self.vec.element())
+            .with_output_sort(self.vec.clone())
+            .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let vec = ValueVec::from_iter(values.iter().copied());
+        vec.store(&self.vec)
+    }
+}
+
+struct Append {
+    name: Symbol,
+    vec: Arc<VecSort>,
+}
+
+impl PrimitiveLike for Append {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        AllEqualTypeConstraint::new(self.name(), span.clone())
+            .with_all_arguments_sort(self.vec.clone())
+            .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let vec = ValueVec::from_iter(values.iter().flat_map(|v| ValueVec::load(&self.vec, v)));
+        vec.store(&self.vec)
+    }
+}
+
+struct Ctor {
+    name: Symbol,
+    vec: Arc<VecSort>,
+}
+
+impl PrimitiveLike for Ctor {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(self.name(), vec![self.vec.clone()], span.clone()).into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        assert!(values.is_empty());
+        ValueVec::default().store(&self.vec)
+    }
+}
+
+struct Push {
+    name: Symbol,
+    vec: Arc<VecSort>,
+}
+
+impl PrimitiveLike for Push {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.vec.clone(), self.vec.element(), self.vec.clone()],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let mut vec = ValueVec::load(&self.vec, &values[0]);
+        vec.push(values[1]);
+        vec.store(&self.vec)
+    }
+}
+
+struct Pop {
+    name: Symbol,
+    vec: Arc<VecSort>,
+}
+
+impl PrimitiveLike for Pop {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.vec.clone(), self.vec.clone()],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let mut vec = ValueVec::load(&self.vec, &values[0]);
+        vec.pop();
+        vec.store(&self.vec)
+    }
+}
+
+struct NotContains {
+    name: Symbol,
+    vec: Arc<VecSort>,
+}
+
+impl PrimitiveLike for NotContains {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.vec.clone(), self.vec.element(), Arc::new(UnitSort)],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let vec = ValueVec::load(&self.vec, &values[0]);
+        if vec.contains(&values[1]) {
+            None
+        } else {
+            Some(Value::unit())
+        }
+    }
+}
+
+struct Contains {
+    name: Symbol,
+    vec: Arc<VecSort>,
+}
+
+impl PrimitiveLike for Contains {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.vec.clone(), self.vec.element(), Arc::new(UnitSort)],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let vec = ValueVec::load(&self.vec, &values[0]);
+        if vec.contains(&values[1]) {
+            Some(Value::unit())
+        } else {
+            None
+        }
+    }
+}
+
+struct Length {
+    name: Symbol,
+    vec: Arc<VecSort>,
+}
+
+impl PrimitiveLike for Length {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.vec.clone(), Arc::new(I64Sort)],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let vec = ValueVec::load(&self.vec, &values[0]);
+        Some(Value::from(vec.len() as i64))
+    }
+}
+
+struct Get {
+    name: Symbol,
+    vec: Arc<VecSort>,
+}
+
+impl PrimitiveLike for Get {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.vec.clone(), Arc::new(I64Sort), self.vec.element()],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let vec = ValueVec::load(&self.vec, &values[0]);
+        let index = i64::load(&I64Sort, &values[1]);
+        vec.get(index as usize).copied()
+    }
+}
+
+struct Set {
+    name: Symbol,
+    vec: Arc<VecSort>,
+}
+
+impl PrimitiveLike for Set {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![
+                self.vec.clone(),
+                Arc::new(I64Sort),
+                self.vec.element.clone(),
+                self.vec.clone(),
+            ],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let mut vec = ValueVec::load(&self.vec, &values[0]);
+        let index = i64::load(&I64Sort, &values[1]);
+        vec[index as usize] = values[2];
+        vec.store(&self.vec)
+    }
+}
+
+struct Remove {
+    name: Symbol,
+    vec: Arc<VecSort>,
+}
+
+impl PrimitiveLike for Remove {
+    fn name(&self) -> Symbol {
+        self.name
+    }
+
+    fn get_type_constraints(&self, span: &Span) -> Box<dyn TypeConstraint> {
+        SimpleTypeConstraint::new(
+            self.name(),
+            vec![self.vec.clone(), Arc::new(I64Sort), self.vec.clone()],
+            span.clone(),
+        )
+        .into_box()
+    }
+
+    fn apply(
+        &self,
+        values: &[Value],
+        _sorts: (&[ArcSort], &ArcSort),
+        _egraph: Option<&mut EGraph>,
+    ) -> Option<Value> {
+        let mut vec = ValueVec::load(&self.vec, &values[0]);
+        let i = i64::load(&I64Sort, &values[1]);
+        vec.remove(i.try_into().unwrap());
+        vec.store(&self.vec)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_vec_make_expr() {
+        let mut egraph = EGraph::default();
+        let outputs = egraph
+            .parse_and_run_program(
+                None,
+                r#"
+            (sort IVec (Vec i64))
+            (let v0 (vec-empty))
+            (let v1 (vec-of 1 2 3 4))
+            (extract v0)
+            (extract v1)
+            "#,
+            )
+            .unwrap();
+
+        // Check extracted expr is parsed as an original expr
+        egraph
+            .parse_and_run_program(
+                None,
+                &format!(
+                    r#"
+                (check (= v0 {}))
+                (check (= v1 {}))
+                "#,
+                    outputs[0], outputs[1],
+                ),
+            )
+            .unwrap();
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/termdag.rs.html b/docs/src/egglog/termdag.rs.html new file mode 100644 index 00000000..a9f9a0d7 --- /dev/null +++ b/docs/src/egglog/termdag.rs.html @@ -0,0 +1,519 @@ +termdag.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+
use crate::{
+    ast::Literal,
+    util::{HashMap, HashSet, IndexSet},
+    Expr, GenericExpr, Symbol,
+};
+
+pub type TermId = usize;
+
+#[allow(rustdoc::private_intra_doc_links)]
+/// Like [`Expr`]s but with sharing and deduplication.
+///
+/// Terms refer to their children indirectly via opaque [TermId]s (internally
+/// these are just `usize`s) that map into an ambient [`TermDag`].
+#[derive(Clone, PartialEq, Eq, Hash, Debug)]
+pub enum Term {
+    Lit(Literal),
+    Var(Symbol),
+    App(Symbol, Vec<TermId>),
+}
+
+/// A hashconsing arena for [`Term`]s.
+#[derive(Clone, PartialEq, Eq, Debug, Default)]
+pub struct TermDag {
+    /// A bidirectional map between deduplicated `Term`s and indices.
+    nodes: IndexSet<Term>,
+}
+
+#[macro_export]
+macro_rules! match_term_app {
+    ($e:expr; $body:tt) => {
+        match $e {
+            Term::App(head, args) => {
+                match (head.as_str(), args.as_slice())
+                    $body
+            }
+            _ => panic!("not an app")
+        }
+    }
+}
+
+impl TermDag {
+    /// Returns the number of nodes in this DAG.
+    pub fn size(&self) -> usize {
+        self.nodes.len()
+    }
+
+    /// Convert the given term to its id.
+    ///
+    /// Panics if the term does not already exist in this [TermDag].
+    pub fn lookup(&self, node: &Term) -> TermId {
+        self.nodes.get_index_of(node).unwrap()
+    }
+
+    /// Convert the given id to the corresponding term.
+    ///
+    /// Panics if the id is not valid.
+    pub fn get(&self, id: TermId) -> &Term {
+        self.nodes.get_index(id).unwrap()
+    }
+
+    /// Make and return a [`Term::App`] with the given head symbol and children,
+    /// and insert into the DAG if it is not already present.
+    ///
+    /// Panics if any of the children are not already in the DAG.
+    pub fn app(&mut self, sym: Symbol, children: Vec<Term>) -> Term {
+        let node = Term::App(sym, children.iter().map(|c| self.lookup(c)).collect());
+
+        self.add_node(&node);
+
+        node
+    }
+
+    /// Make and return a [`Term::Lit`] with the given literal, and insert into
+    /// the DAG if it is not already present.
+    pub fn lit(&mut self, lit: Literal) -> Term {
+        let node = Term::Lit(lit);
+
+        self.add_node(&node);
+
+        node
+    }
+
+    /// Make and return a [`Term::Var`] with the given symbol, and insert into
+    /// the DAG if it is not already present.
+    pub fn var(&mut self, sym: Symbol) -> Term {
+        let node = Term::Var(sym);
+
+        self.add_node(&node);
+
+        node
+    }
+
+    fn add_node(&mut self, node: &Term) {
+        if self.nodes.get(node).is_none() {
+            self.nodes.insert(node.clone());
+        }
+    }
+
+    /// Recursively converts the given expression to a term.
+    ///
+    /// This involves inserting every subexpression into this DAG. Because
+    /// TermDags are hashconsed, the resulting term is guaranteed to maximally
+    /// share subterms.
+    pub fn expr_to_term(&mut self, expr: &GenericExpr<Symbol, Symbol>) -> Term {
+        let res = match expr {
+            GenericExpr::Lit(_, lit) => Term::Lit(lit.clone()),
+            GenericExpr::Var(_, v) => Term::Var(*v),
+            GenericExpr::Call(_, op, args) => {
+                let args = args
+                    .iter()
+                    .map(|a| {
+                        let term = self.expr_to_term(a);
+                        self.lookup(&term)
+                    })
+                    .collect();
+                Term::App(*op, args)
+            }
+        };
+        self.add_node(&res);
+        res
+    }
+
+    /// Recursively converts the given term to an expression.
+    ///
+    /// Panics if the term contains subterms that are not in the DAG.
+    pub fn term_to_expr(&self, term: &Term) -> Expr {
+        match term {
+            Term::Lit(lit) => Expr::lit_no_span(lit.clone()),
+            Term::Var(v) => Expr::var_no_span(*v),
+            Term::App(op, args) => {
+                let args: Vec<_> = args
+                    .iter()
+                    .map(|a| self.term_to_expr(self.get(*a)))
+                    .collect();
+                Expr::call_no_span(*op, args)
+            }
+        }
+    }
+
+    /// Converts the given term to a string.
+    ///
+    /// Panics if the term or any of its subterms are not in the DAG.
+    pub fn to_string(&self, term: &Term) -> String {
+        let mut stored = HashMap::<TermId, String>::default();
+        let mut seen = HashSet::<TermId>::default();
+        let id = self.lookup(term);
+        // use a stack to avoid stack overflow
+        let mut stack = vec![id];
+        while let Some(next) = stack.pop() {
+            match self.nodes[next].clone() {
+                Term::App(name, children) => {
+                    if seen.contains(&next) {
+                        let mut str = String::new();
+                        str.push_str(&format!("({}", name));
+                        for c in children.iter() {
+                            str.push_str(&format!(" {}", stored[c]));
+                        }
+                        str.push(')');
+                        stored.insert(next, str);
+                    } else {
+                        seen.insert(next);
+                        stack.push(next);
+                        for c in children.iter().rev() {
+                            stack.push(*c);
+                        }
+                    }
+                }
+                Term::Lit(lit) => {
+                    stored.insert(next, format!("{}", lit));
+                }
+                Term::Var(v) => {
+                    stored.insert(next, format!("{}", v));
+                }
+            }
+        }
+
+        stored.get(&id).unwrap().clone()
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::ast::*;
+
+    fn parse_term(s: &str) -> (TermDag, Term) {
+        let e = parse_expr(None, s).unwrap();
+        let mut td = TermDag::default();
+        let t = td.expr_to_term(&e);
+        (td, t)
+    }
+
+    #[test]
+    fn test_to_from_expr() {
+        let s = r#"(f (g x y) x y (g x y))"#;
+        let e = parse_expr(None, s).unwrap();
+        let mut td = TermDag::default();
+        assert_eq!(td.size(), 0);
+        let t = td.expr_to_term(&e);
+        assert_eq!(td.size(), 4);
+        // the expression above has 4 distinct subterms.
+        // in left-to-right, depth-first order, they are:
+        //     x, y, (g x y), and the root call to f
+        // so we can compute expected answer by hand:
+        assert_eq!(
+            td.nodes.as_slice().iter().cloned().collect::<Vec<_>>(),
+            vec![
+                Term::Var("x".into()),
+                Term::Var("y".into()),
+                Term::App("g".into(), vec![0, 1]),
+                Term::App("f".into(), vec![2, 0, 1, 2]),
+            ]
+        );
+        let e2 = td.term_to_expr(&t);
+        // This is tested using Sexp's equality because e1 and e2 have different
+        // annotations. A better way to test this would be to implement a map_ann
+        // function for GenericExpr.
+        assert_eq!(e.to_sexp(), e2.to_sexp()); // roundtrip
+    }
+
+    #[test]
+    fn test_match_term_app() {
+        let s = r#"(f (g x y) x y (g x y))"#;
+        let (td, t) = parse_term(s);
+        match_term_app!(t; {
+            ("f", [_, x, _, _]) => assert_eq!(
+                td.term_to_expr(td.get(*x)),
+                crate::ast::GenericExpr::Var(DUMMY_SPAN.clone(), Symbol::new("x"))
+            ),
+            (head, _) => panic!("unexpected head {}, in {}:{}:{}", head, file!(), line!(), column!())
+        })
+    }
+
+    #[test]
+    fn test_to_string() {
+        let s = r#"(f (g x y) x y (g x y))"#;
+        let (td, t) = parse_term(s);
+        assert_eq!(td.to_string(&t), s);
+    }
+
+    #[test]
+    fn test_lookup() {
+        let s = r#"(f (g x y) x y (g x y))"#;
+        let (td, t) = parse_term(s);
+        assert_eq!(td.lookup(&t), td.size() - 1);
+    }
+
+    #[test]
+    fn test_app_var_lit() {
+        let s = r#"(f (g x y) x 7 (g x y))"#;
+        let (mut td, t) = parse_term(s);
+        let x = td.var("x".into());
+        let y = td.var("y".into());
+        let seven = td.lit(7.into());
+        let g = td.app("g".into(), vec![x.clone(), y.clone()]);
+        let t2 = td.app("f".into(), vec![g.clone(), x, seven, g]);
+        assert_eq!(t, t2);
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/typechecking.rs.html b/docs/src/egglog/typechecking.rs.html new file mode 100644 index 00000000..ca761925 --- /dev/null +++ b/docs/src/egglog/typechecking.rs.html @@ -0,0 +1,1093 @@ +typechecking.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+
use crate::{core::CoreRule, *};
+use ast::Rule;
+
+#[derive(Clone, Debug)]
+pub struct FuncType {
+    pub name: Symbol,
+    pub input: Vec<ArcSort>,
+    pub output: ArcSort,
+    pub is_datatype: bool,
+    pub has_default: bool,
+}
+
+/// Stores resolved typechecking information.
+/// TODO make these not public, use accessor methods
+#[derive(Clone)]
+pub struct TypeInfo {
+    // get the sort from the sorts name()
+    pub presorts: HashMap<Symbol, PreSort>,
+    // TODO(yz): I want to get rid of this as now we have user-defined primitives and constraint based type checking
+    pub reserved_primitives: HashSet<Symbol>,
+    pub sorts: HashMap<Symbol, Arc<dyn Sort>>,
+    pub primitives: HashMap<Symbol, Vec<Primitive>>,
+    pub func_types: HashMap<Symbol, FuncType>,
+    pub global_types: HashMap<Symbol, ArcSort>,
+}
+
+impl Default for TypeInfo {
+    fn default() -> Self {
+        let mut res = Self {
+            presorts: Default::default(),
+            reserved_primitives: Default::default(),
+            sorts: Default::default(),
+            primitives: Default::default(),
+            func_types: Default::default(),
+            global_types: Default::default(),
+        };
+
+        res.add_sort(UnitSort, DUMMY_SPAN.clone()).unwrap();
+        res.add_sort(StringSort, DUMMY_SPAN.clone()).unwrap();
+        res.add_sort(BoolSort, DUMMY_SPAN.clone()).unwrap();
+        res.add_sort(I64Sort, DUMMY_SPAN.clone()).unwrap();
+        res.add_sort(F64Sort, DUMMY_SPAN.clone()).unwrap();
+        res.add_sort(RationalSort, DUMMY_SPAN.clone()).unwrap();
+        res.add_sort(BigIntSort, DUMMY_SPAN.clone()).unwrap();
+        res.add_sort(BigRatSort, DUMMY_SPAN.clone()).unwrap();
+
+        res.add_presort::<MapSort>(DUMMY_SPAN.clone()).unwrap();
+        res.add_presort::<SetSort>(DUMMY_SPAN.clone()).unwrap();
+        res.add_presort::<VecSort>(DUMMY_SPAN.clone()).unwrap();
+        res.add_presort::<FunctionSort>(DUMMY_SPAN.clone()).unwrap();
+        res.add_presort::<MultiSetSort>(DUMMY_SPAN.clone()).unwrap();
+
+        res.add_primitive(ValueEq);
+
+        res
+    }
+}
+
+impl TypeInfo {
+    pub fn add_sort<S: Sort + 'static>(&mut self, sort: S, span: Span) -> Result<(), TypeError> {
+        self.add_arcsort(Arc::new(sort), span)
+    }
+
+    /// Adds a sort constructor to the typechecker's known set of types.
+    pub fn add_presort<S: Presort>(&mut self, span: Span) -> Result<(), TypeError> {
+        let name = S::presort_name();
+        match self.presorts.entry(name) {
+            HEntry::Occupied(_) => Err(TypeError::SortAlreadyBound(name, span)),
+            HEntry::Vacant(e) => {
+                e.insert(S::make_sort);
+                self.reserved_primitives.extend(S::reserved_primitives());
+                Ok(())
+            }
+        }
+    }
+
+    pub fn add_arcsort(&mut self, sort: ArcSort, span: Span) -> Result<(), TypeError> {
+        let name = sort.name();
+
+        match self.sorts.entry(name) {
+            HEntry::Occupied(_) => Err(TypeError::SortAlreadyBound(name, span)),
+            HEntry::Vacant(e) => {
+                e.insert(sort.clone());
+                sort.register_primitives(self);
+                Ok(())
+            }
+        }
+    }
+
+    pub fn get_sort_by<S: Sort + Send + Sync>(
+        &self,
+        pred: impl Fn(&Arc<S>) -> bool,
+    ) -> Option<Arc<S>> {
+        for sort in self.sorts.values() {
+            let sort = sort.clone().as_arc_any();
+            if let Ok(sort) = Arc::downcast(sort) {
+                if pred(&sort) {
+                    return Some(sort);
+                }
+            }
+        }
+        None
+    }
+
+    pub fn get_sort_nofail<S: Sort + Send + Sync>(&self) -> Arc<S> {
+        match self.get_sort_by(|_| true) {
+            Some(sort) => sort,
+            None => panic!("Failed to lookup sort: {}", std::any::type_name::<S>()),
+        }
+    }
+
+    pub fn add_primitive(&mut self, prim: impl Into<Primitive>) {
+        let prim = prim.into();
+        self.primitives.entry(prim.name()).or_default().push(prim);
+    }
+
+    pub(crate) fn typecheck_program(
+        &mut self,
+        symbol_gen: &mut SymbolGen,
+        program: &Vec<NCommand>,
+    ) -> Result<Vec<ResolvedNCommand>, TypeError> {
+        let mut result = vec![];
+        for command in program {
+            result.push(self.typecheck_command(symbol_gen, command)?);
+        }
+
+        Ok(result)
+    }
+
+    pub(crate) fn function_to_functype(&self, func: &FunctionDecl) -> Result<FuncType, TypeError> {
+        let input = func
+            .schema
+            .input
+            .iter()
+            .map(|name| {
+                if let Some(sort) = self.sorts.get(name) {
+                    Ok(sort.clone())
+                } else {
+                    Err(TypeError::UndefinedSort(*name, func.span.clone()))
+                }
+            })
+            .collect::<Result<Vec<_>, _>>()?;
+        let output = if let Some(sort) = self.sorts.get(&func.schema.output) {
+            Ok(sort.clone())
+        } else {
+            Err(TypeError::UndefinedSort(
+                func.schema.output,
+                func.span.clone(),
+            ))
+        }?;
+
+        Ok(FuncType {
+            name: func.name,
+            input,
+            output: output.clone(),
+            is_datatype: output.is_eq_sort() && func.merge.is_none() && func.default.is_none(),
+            has_default: func.default.is_some(),
+        })
+    }
+
+    fn typecheck_command(
+        &mut self,
+        symbol_gen: &mut SymbolGen,
+        command: &NCommand,
+    ) -> Result<ResolvedNCommand, TypeError> {
+        let command: ResolvedNCommand =
+            match command {
+                NCommand::Function(fdecl) => {
+                    ResolvedNCommand::Function(self.typecheck_function(symbol_gen, fdecl)?)
+                }
+                NCommand::NormRule {
+                    rule,
+                    ruleset,
+                    name,
+                } => ResolvedNCommand::NormRule {
+                    rule: self.typecheck_rule(symbol_gen, rule)?,
+                    ruleset: *ruleset,
+                    name: *name,
+                },
+                NCommand::Sort(span, sort, presort_and_args) => {
+                    // Note this is bad since typechecking should be pure and idempotent
+                    // Otherwise typechecking the same program twice will fail
+                    self.declare_sort(*sort, presort_and_args, span.clone())?;
+                    ResolvedNCommand::Sort(span.clone(), *sort, presort_and_args.clone())
+                }
+                NCommand::CoreAction(Action::Let(span, var, expr)) => {
+                    let expr = self.typecheck_expr(symbol_gen, expr, &Default::default())?;
+                    let output_type = expr.output_type();
+                    self.global_types.insert(*var, output_type.clone());
+                    let var = ResolvedVar {
+                        name: *var,
+                        sort: output_type,
+                        // not a global reference, but a global binding
+                        is_global_ref: false,
+                    };
+                    ResolvedNCommand::CoreAction(ResolvedAction::Let(span.clone(), var, expr))
+                }
+                NCommand::CoreAction(action) => ResolvedNCommand::CoreAction(
+                    self.typecheck_action(symbol_gen, action, &Default::default())?,
+                ),
+                NCommand::Check(span, facts) => {
+                    ResolvedNCommand::Check(span.clone(), self.typecheck_facts(symbol_gen, facts)?)
+                }
+                NCommand::Fail(span, cmd) => ResolvedNCommand::Fail(
+                    span.clone(),
+                    Box::new(self.typecheck_command(symbol_gen, cmd)?),
+                ),
+                NCommand::RunSchedule(schedule) => {
+                    ResolvedNCommand::RunSchedule(self.typecheck_schedule(symbol_gen, schedule)?)
+                }
+                NCommand::Pop(span, n) => ResolvedNCommand::Pop(span.clone(), *n),
+                NCommand::Push(n) => ResolvedNCommand::Push(*n),
+                NCommand::SetOption { name, value } => {
+                    let value = self.typecheck_expr(symbol_gen, value, &Default::default())?;
+                    ResolvedNCommand::SetOption { name: *name, value }
+                }
+                NCommand::AddRuleset(ruleset) => ResolvedNCommand::AddRuleset(*ruleset),
+                NCommand::UnstableCombinedRuleset(name, sub_rulesets) => {
+                    ResolvedNCommand::UnstableCombinedRuleset(*name, sub_rulesets.clone())
+                }
+                NCommand::PrintOverallStatistics => ResolvedNCommand::PrintOverallStatistics,
+                NCommand::PrintTable(span, table, size) => {
+                    ResolvedNCommand::PrintTable(span.clone(), *table, *size)
+                }
+                NCommand::PrintSize(span, n) => {
+                    // Should probably also resolve the function symbol here
+                    ResolvedNCommand::PrintSize(span.clone(), *n)
+                }
+                NCommand::Output { span, file, exprs } => {
+                    let exprs = exprs
+                        .iter()
+                        .map(|expr| self.typecheck_expr(symbol_gen, expr, &Default::default()))
+                        .collect::<Result<Vec<_>, _>>()?;
+                    ResolvedNCommand::Output {
+                        span: span.clone(),
+                        file: file.clone(),
+                        exprs,
+                    }
+                }
+                NCommand::Input { span, name, file } => ResolvedNCommand::Input {
+                    span: span.clone(),
+                    name: *name,
+                    file: file.clone(),
+                },
+            };
+        Ok(command)
+    }
+
+    fn typecheck_function(
+        &mut self,
+        symbol_gen: &mut SymbolGen,
+        fdecl: &FunctionDecl,
+    ) -> Result<ResolvedFunctionDecl, TypeError> {
+        if self.sorts.contains_key(&fdecl.name) {
+            return Err(TypeError::SortAlreadyBound(fdecl.name, fdecl.span.clone()));
+        }
+        if self.is_primitive(fdecl.name) {
+            return Err(TypeError::PrimitiveAlreadyBound(
+                fdecl.name,
+                fdecl.span.clone(),
+            ));
+        }
+        let ftype = self.function_to_functype(fdecl)?;
+        if self.func_types.insert(fdecl.name, ftype).is_some() {
+            return Err(TypeError::FunctionAlreadyBound(
+                fdecl.name,
+                fdecl.span.clone(),
+            ));
+        }
+        let mut bound_vars = IndexMap::default();
+        let output_type = self.sorts.get(&fdecl.schema.output).unwrap();
+        bound_vars.insert("old".into(), (DUMMY_SPAN.clone(), output_type.clone()));
+        bound_vars.insert("new".into(), (DUMMY_SPAN.clone(), output_type.clone()));
+
+        Ok(ResolvedFunctionDecl {
+            name: fdecl.name,
+            schema: fdecl.schema.clone(),
+            merge: match &fdecl.merge {
+                Some(merge) => Some(self.typecheck_expr(symbol_gen, merge, &bound_vars)?),
+                None => None,
+            },
+            default: fdecl
+                .default
+                .as_ref()
+                .map(|default| self.typecheck_expr(symbol_gen, default, &Default::default()))
+                .transpose()?,
+            merge_action: self.typecheck_actions(symbol_gen, &fdecl.merge_action, &bound_vars)?,
+            cost: fdecl.cost,
+            unextractable: fdecl.unextractable,
+            ignore_viz: fdecl.ignore_viz,
+            span: fdecl.span.clone(),
+        })
+    }
+
+    fn typecheck_schedule(
+        &self,
+        symbol_gen: &mut SymbolGen,
+        schedule: &Schedule,
+    ) -> Result<ResolvedSchedule, TypeError> {
+        let schedule = match schedule {
+            Schedule::Repeat(span, times, schedule) => ResolvedSchedule::Repeat(
+                span.clone(),
+                *times,
+                Box::new(self.typecheck_schedule(symbol_gen, schedule)?),
+            ),
+            Schedule::Sequence(span, schedules) => {
+                let schedules = schedules
+                    .iter()
+                    .map(|schedule| self.typecheck_schedule(symbol_gen, schedule))
+                    .collect::<Result<Vec<_>, _>>()?;
+                ResolvedSchedule::Sequence(span.clone(), schedules)
+            }
+            Schedule::Saturate(span, schedule) => ResolvedSchedule::Saturate(
+                span.clone(),
+                Box::new(self.typecheck_schedule(symbol_gen, schedule)?),
+            ),
+            Schedule::Run(span, RunConfig { ruleset, until }) => {
+                let until = until
+                    .as_ref()
+                    .map(|facts| self.typecheck_facts(symbol_gen, facts))
+                    .transpose()?;
+                ResolvedSchedule::Run(
+                    span.clone(),
+                    ResolvedRunConfig {
+                        ruleset: *ruleset,
+                        until,
+                    },
+                )
+            }
+        };
+
+        Result::Ok(schedule)
+    }
+
+    pub fn declare_sort(
+        &mut self,
+        name: impl Into<Symbol>,
+        presort_and_args: &Option<(Symbol, Vec<Expr>)>,
+        span: Span,
+    ) -> Result<(), TypeError> {
+        let name = name.into();
+        if self.func_types.contains_key(&name) {
+            return Err(TypeError::FunctionAlreadyBound(name, span));
+        }
+
+        let sort = match presort_and_args {
+            Some((presort, args)) => {
+                if let Some(mksort) = self.presorts.get(presort) {
+                    mksort(self, name, args)?
+                } else {
+                    return Err(TypeError::PresortNotFound(*presort, span));
+                }
+            }
+            None => Arc::new(EqSort { name }),
+        };
+        self.add_arcsort(sort, span)
+    }
+
+    fn typecheck_rule(
+        &self,
+        symbol_gen: &mut SymbolGen,
+        rule: &Rule,
+    ) -> Result<ResolvedRule, TypeError> {
+        let Rule { span, head, body } = rule;
+        let mut constraints = vec![];
+
+        let (query, mapped_query) = Facts(body.clone()).to_query(self, symbol_gen);
+        constraints.extend(query.get_constraints(self)?);
+
+        let mut binding = query.get_vars();
+        let (actions, mapped_action) = head.to_core_actions(self, &mut binding, symbol_gen)?;
+
+        let mut problem = Problem::default();
+        problem.add_rule(
+            &CoreRule {
+                span: span.clone(),
+                body: query,
+                head: actions,
+            },
+            self,
+            symbol_gen,
+        )?;
+
+        let assignment = problem
+            .solve(|sort: &ArcSort| sort.name())
+            .map_err(|e| e.to_type_error())?;
+
+        let body: Vec<ResolvedFact> = assignment.annotate_facts(&mapped_query, self);
+        let actions: ResolvedActions = assignment.annotate_actions(&mapped_action, self)?;
+
+        Ok(ResolvedRule {
+            span: span.clone(),
+            body,
+            head: actions,
+        })
+    }
+
+    fn typecheck_facts(
+        &self,
+        symbol_gen: &mut SymbolGen,
+        facts: &[Fact],
+    ) -> Result<Vec<ResolvedFact>, TypeError> {
+        let (query, mapped_facts) = Facts(facts.to_vec()).to_query(self, symbol_gen);
+        let mut problem = Problem::default();
+        problem.add_query(&query, self)?;
+        let assignment = problem
+            .solve(|sort: &ArcSort| sort.name())
+            .map_err(|e| e.to_type_error())?;
+        let annotated_facts = assignment.annotate_facts(&mapped_facts, self);
+        Ok(annotated_facts)
+    }
+
+    fn typecheck_actions(
+        &self,
+        symbol_gen: &mut SymbolGen,
+        actions: &Actions,
+        binding: &IndexMap<Symbol, (Span, ArcSort)>,
+    ) -> Result<ResolvedActions, TypeError> {
+        let mut binding_set = binding.keys().cloned().collect::<IndexSet<_>>();
+        let (actions, mapped_action) =
+            actions.to_core_actions(self, &mut binding_set, symbol_gen)?;
+        let mut problem = Problem::default();
+
+        // add actions to problem
+        problem.add_actions(&actions, self, symbol_gen)?;
+
+        // add bindings from the context
+        for (var, (span, sort)) in binding {
+            problem.assign_local_var_type(*var, span.clone(), sort.clone())?;
+        }
+
+        let assignment = problem
+            .solve(|sort: &ArcSort| sort.name())
+            .map_err(|e| e.to_type_error())?;
+
+        let annotated_actions = assignment.annotate_actions(&mapped_action, self)?;
+        Ok(annotated_actions)
+    }
+
+    fn typecheck_expr(
+        &self,
+        symbol_gen: &mut SymbolGen,
+        expr: &Expr,
+        binding: &IndexMap<Symbol, (Span, ArcSort)>,
+    ) -> Result<ResolvedExpr, TypeError> {
+        let action = Action::Expr(DUMMY_SPAN.clone(), expr.clone());
+        let typechecked_action = self.typecheck_action(symbol_gen, &action, binding)?;
+        match typechecked_action {
+            ResolvedAction::Expr(_, expr) => Ok(expr),
+            _ => unreachable!(),
+        }
+    }
+
+    fn typecheck_action(
+        &self,
+        symbol_gen: &mut SymbolGen,
+        action: &Action,
+        binding: &IndexMap<Symbol, (Span, ArcSort)>,
+    ) -> Result<ResolvedAction, TypeError> {
+        self.typecheck_actions(symbol_gen, &Actions::singleton(action.clone()), binding)
+            .map(|mut v| {
+                assert_eq!(v.len(), 1);
+                v.0.pop().unwrap()
+            })
+    }
+
+    pub fn lookup_global(&self, sym: &Symbol) -> Option<ArcSort> {
+        self.global_types.get(sym).cloned()
+    }
+
+    pub(crate) fn is_primitive(&self, sym: Symbol) -> bool {
+        self.primitives.contains_key(&sym) || self.reserved_primitives.contains(&sym)
+    }
+
+    pub(crate) fn lookup_user_func(&self, sym: Symbol) -> Option<FuncType> {
+        self.func_types.get(&sym).cloned()
+    }
+
+    pub(crate) fn is_global(&self, sym: Symbol) -> bool {
+        self.global_types.contains_key(&sym)
+    }
+}
+
+#[derive(Debug, Clone, Error)]
+pub enum TypeError {
+    #[error("{}\nArity mismatch, expected {expected} args: {expr}", .expr.span())]
+    Arity { expr: Expr, expected: usize },
+    #[error(
+        "{}\n Expect expression {expr} to have type {}, but get type {}",
+        .expr.span(), .expected.name(), .actual.name(),
+    )]
+    Mismatch {
+        expr: Expr,
+        expected: ArcSort,
+        actual: ArcSort,
+    },
+    #[error("{1}\nUnbound symbol {0}")]
+    Unbound(Symbol, Span),
+    #[error("{1}\nUndefined sort {0}")]
+    UndefinedSort(Symbol, Span),
+    #[error("{2}\nSort {0} definition is disallowed: {1}")]
+    DisallowedSort(Symbol, String, Span),
+    #[error("{1}\nUnbound function {0}")]
+    UnboundFunction(Symbol, Span),
+    #[error("{1}\nFunction already bound {0}")]
+    FunctionAlreadyBound(Symbol, Span),
+    #[error("{1}\nSort {0} already declared.")]
+    SortAlreadyBound(Symbol, Span),
+    #[error("{1}\nPrimitive {0} already declared.")]
+    PrimitiveAlreadyBound(Symbol, Span),
+    #[error("Function type mismatch: expected {} => {}, actual {} => {}", .1.iter().map(|s| s.name().to_string()).collect::<Vec<_>>().join(", "), .0.name(), .3.iter().map(|s| s.name().to_string()).collect::<Vec<_>>().join(", "), .2.name())]
+    FunctionTypeMismatch(ArcSort, Vec<ArcSort>, ArcSort, Vec<ArcSort>),
+    #[error("{1}\nPresort {0} not found.")]
+    PresortNotFound(Symbol, Span),
+    #[error("{}\nFailed to infer a type for: {0}", .0.span())]
+    InferenceFailure(Expr),
+    #[error("{1}\nVariable {0} was already defined")]
+    AlreadyDefined(Symbol, Span),
+    #[error("All alternative definitions considered failed\n{}", .0.iter().map(|e| format!("  {e}\n")).collect::<Vec<_>>().join(""))]
+    AllAlternativeFailed(Vec<TypeError>),
+}
+
+#[cfg(test)]
+mod test {
+    use crate::{typechecking::TypeError, EGraph, Error};
+
+    #[test]
+    fn test_arity_mismatch() {
+        let mut egraph = EGraph::default();
+
+        let prog = "
+            (relation f (i64 i64))
+            (rule ((f a b c)) ())
+       ";
+        let res = egraph.parse_and_run_program(None, prog);
+        match res {
+            Err(Error::TypeError(TypeError::Arity {
+                expected: 2,
+                expr: e,
+            })) => {
+                assert_eq!(e.span().string(), "(f a b c)");
+            }
+            _ => panic!("Expected arity mismatch, got: {:?}", res),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/unionfind.rs.html b/docs/src/egglog/unionfind.rs.html new file mode 100644 index 00000000..f8f77044 --- /dev/null +++ b/docs/src/egglog/unionfind.rs.html @@ -0,0 +1,361 @@ +unionfind.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+
//! Baseline union-find implementation without sizes or ranks, using path
+//! halving for compression.
+//!
+//! This implementation uses interior mutability for `find`.
+use crate::util::HashMap;
+use crate::{Symbol, Value};
+
+use std::cell::Cell;
+use std::fmt::Debug;
+use std::mem;
+
+pub type Id = u64;
+
+#[derive(Debug, Clone, Default)]
+#[cfg_attr(feature = "serde-1", derive(serde::Serialize, serde::Deserialize))]
+pub struct UnionFind {
+    parents: Vec<Cell<Id>>,
+    n_unions: usize,
+    recent_ids: HashMap<Symbol, Vec<Id>>,
+    staged_ids: HashMap<Symbol, Vec<Id>>,
+}
+
+impl UnionFind {
+    /// The number of unions that have been performed over the lifetime of this
+    /// data-structure.
+    pub fn n_unions(&self) -> usize {
+        self.n_unions
+    }
+
+    /// Create a fresh [`Id`].
+    pub fn make_set(&mut self) -> Id {
+        let res = self.parents.len() as u64;
+        self.parents.push(Cell::new(res));
+        res
+    }
+
+    /// The number of ids that recently stopped being canonical.
+    pub fn new_ids(&self, sort_filter: impl Fn(Symbol) -> bool) -> usize {
+        self.recent_ids
+            .iter()
+            .filter_map(|(sort, ids)| {
+                if sort_filter(*sort) {
+                    Some(ids.len())
+                } else {
+                    None
+                }
+            })
+            .sum()
+    }
+
+    /// Clear any ids currently marked as dirty and then move any ids marked
+    /// non-canonical since the last call to this method (or the
+    /// data-structure's creation) into the dirty set.
+    pub fn clear_recent_ids(&mut self) {
+        mem::swap(&mut self.recent_ids, &mut self.staged_ids);
+        self.staged_ids.values_mut().for_each(Vec::clear);
+    }
+
+    /// Iterate over the ids of the given sort marked as "dirty", i.e. any
+    /// [`Id`]s that ceased to be canonical between the last call to
+    /// [`clear_recent_ids`] and the call prior to that.
+    ///
+    /// [`clear_recent_ids`]: UnionFind::clear_recent_ids
+    pub fn dirty_ids(&self, sort: Symbol) -> impl Iterator<Item = Id> + '_ {
+        let ids = self
+            .recent_ids
+            .get(&sort)
+            .map(|ids| ids.as_slice())
+            .unwrap_or(&[]);
+        ids.iter().copied()
+    }
+
+    /// Look up the canonical representative for the given [`Id`].
+    pub fn find(&self, id: Id) -> Id {
+        let mut cur = self.parent(id);
+        loop {
+            let next = self.parent(cur.get());
+            if cur.get() == next.get() {
+                return cur.get();
+            }
+            // Path halving
+            let grand = self.parent(next.get());
+            cur.set(grand.get());
+            cur = grand;
+        }
+    }
+
+    /// Merge the equivalence classes associated with the two values.
+    ///
+    /// This method assumes that the given values belong to the same, "eq-able",
+    /// sort. Its behavior is unspecified on other values.
+    pub fn union_values(&mut self, val1: Value, val2: Value, sort: Symbol) -> Value {
+        #[cfg(debug_assertions)]
+        debug_assert_eq!(val1.tag, val2.tag);
+
+        Value {
+            #[cfg(debug_assertions)]
+            tag: val1.tag,
+            bits: self.union(val1.bits, val2.bits, sort),
+        }
+    }
+
+    /// Like [`union_values`], but operating on raw [`Id`]s.
+    ///
+    /// [`union_values`]: UnionFind::union_values
+    pub fn union(&mut self, id1: Id, id2: Id, sort: Symbol) -> Id {
+        let (res, reparented) = self.do_union(id1, id2);
+        if let Some(id) = reparented {
+            self.staged_ids.entry(sort).or_default().push(id)
+        }
+        res
+    }
+
+    /// Merge the underlying equivalence classes for the two ids.
+    ///
+    /// This method does not update any metadata related to timestamps or sorts;
+    /// that metadata will eventually be required for the correctness of
+    /// rebuilding. This method should only be used for "out-of-band" use-cases,
+    /// such as typechecking.
+    pub fn union_raw(&mut self, id1: Id, id2: Id) -> Id {
+        self.do_union(id1, id2).0
+    }
+
+    fn do_union(&mut self, id1: Id, id2: Id) -> (Id, Option<Id>) {
+        let id1 = self.find(id1);
+        let id2 = self.find(id2);
+        if id1 != id2 {
+            self.parent(id2).set(id1);
+            self.n_unions += 1;
+            (id1, Some(id2))
+        } else {
+            (id1, None)
+        }
+    }
+
+    fn parent(&self, id: Id) -> &Cell<Id> {
+        &self.parents[id as usize]
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    fn ids(us: impl IntoIterator<Item = Id>) -> Vec<Cell<Id>> {
+        us.into_iter().map(Cell::new).collect()
+    }
+
+    #[test]
+    fn union_find() {
+        let n = 10;
+
+        let mut uf = UnionFind::default();
+        for _ in 0..n {
+            uf.make_set();
+        }
+
+        // test the initial condition of everyone in their own set
+        assert_eq!(uf.parents, ids(0..n));
+
+        // build up one set
+        uf.union_raw(0, 1);
+        uf.union_raw(0, 2);
+        uf.union_raw(0, 3);
+
+        // build up another set
+        uf.union_raw(6, 7);
+        uf.union_raw(6, 8);
+        uf.union_raw(6, 9);
+
+        // this should compress all paths
+        for i in 0..n {
+            uf.find(i);
+        }
+
+        // indexes:         0, 1, 2, 3, 4, 5, 6, 7, 8, 9
+        let expected = vec![0, 0, 0, 0, 4, 5, 6, 6, 6, 6];
+        assert_eq!(uf.parents, ids(expected));
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/util.rs.html b/docs/src/egglog/util.rs.html new file mode 100644 index 00000000..a12f35ab --- /dev/null +++ b/docs/src/egglog/util.rs.html @@ -0,0 +1,283 @@ +util.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+
#![allow(unused)]
+
+use std::fmt::Display;
+
+use crate::core::SpecializedPrimitive;
+#[allow(unused_imports)]
+use crate::*;
+
+pub(crate) type BuildHasher = std::hash::BuildHasherDefault<rustc_hash::FxHasher>;
+
+/// Use an index map by default everywhere.
+/// We could fix the seed, but symbol generation is not determinisic so
+/// this doesn't fix the problem.
+#[cfg(not(feature = "nondeterministic"))]
+pub(crate) type HashMap<K, V> = indexmap::IndexMap<K, V, BuildHasher>;
+#[cfg(feature = "nondeterministic")]
+pub(crate) type HashMap<K, V> = hashbrown::HashMap<K, V, BuildHasher>;
+
+#[cfg(not(feature = "nondeterministic"))]
+pub(crate) type HashSet<K> = indexmap::IndexSet<K, BuildHasher>;
+#[cfg(feature = "nondeterministic")]
+pub(crate) type HashSet<K> = hashbrown::HashSet<K, BuildHasher>;
+
+#[cfg(feature = "nondeterministic")]
+pub(crate) type HEntry<'a, A, B, D> = hashbrown::hash_map::Entry<'a, A, B, D>;
+#[cfg(not(feature = "nondeterministic"))]
+pub(crate) type HEntry<'a, A, B> = Entry<'a, A, B>;
+
+pub type IndexMap<K, V> = indexmap::IndexMap<K, V, BuildHasher>;
+pub type IndexSet<K> = indexmap::IndexSet<K, BuildHasher>;
+
+pub(crate) fn concat_vecs<T>(to: &mut Vec<T>, mut from: Vec<T>) {
+    if to.len() < from.len() {
+        std::mem::swap(to, &mut from)
+    }
+    to.extend(from);
+}
+
+pub(crate) struct ListDisplay<'a, TS>(pub TS, pub &'a str);
+
+impl<'a, TS> Display for ListDisplay<'a, TS>
+where
+    TS: Clone + IntoIterator,
+    TS::Item: Display,
+{
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        let mut did_something = false;
+        for item in self.0.clone().into_iter() {
+            if did_something {
+                f.write_str(self.1)?;
+            }
+            Display::fmt(&item, f)?;
+            did_something = true;
+        }
+        Ok(())
+    }
+}
+
+pub(crate) struct ListDebug<'a, TS>(pub TS, pub &'a str);
+
+impl<'a, TS> Debug for ListDebug<'a, TS>
+where
+    TS: Clone + IntoIterator,
+    TS::Item: Debug,
+{
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        let mut did_something = false;
+        for item in self.0.clone().into_iter() {
+            if did_something {
+                f.write_str(self.1)?;
+            }
+            Debug::fmt(&item, f)?;
+            did_something = true;
+        }
+        Ok(())
+    }
+}
+
+/// Generates fresh symbols for internal use during typechecking and flattening.
+/// These are guaranteed not to collide with the
+/// user's symbols because they use $.
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub struct SymbolGen {
+    gen: usize,
+    reserved_string: String,
+}
+
+impl SymbolGen {
+    pub fn new(reserved_string: String) -> Self {
+        Self {
+            gen: 0,
+            reserved_string,
+        }
+    }
+
+    pub fn has_been_used(&self) -> bool {
+        self.gen > 0
+    }
+}
+
+/// This trait lets us statically dispatch between `fresh` methods for generic structs.
+pub trait FreshGen<Head, Leaf> {
+    fn fresh(&mut self, name_hint: &Head) -> Leaf;
+}
+
+impl FreshGen<Symbol, Symbol> for SymbolGen {
+    fn fresh(&mut self, name_hint: &Symbol) -> Symbol {
+        let s = format!("{}{}{}", self.reserved_string, name_hint, self.gen);
+        self.gen += 1;
+        Symbol::from(s)
+    }
+}
+
+impl FreshGen<ResolvedCall, ResolvedVar> for SymbolGen {
+    fn fresh(&mut self, name_hint: &ResolvedCall) -> ResolvedVar {
+        let s = format!("{}{}{}", self.reserved_string, name_hint, self.gen);
+        self.gen += 1;
+        let sort = match name_hint {
+            ResolvedCall::Func(f) => f.output.clone(),
+            ResolvedCall::Primitive(SpecializedPrimitive { output, .. }) => output.clone(),
+        };
+        ResolvedVar {
+            name: s.into(),
+            sort,
+            // fresh variables are never global references, since globals
+            // are desugared away by `remove_globals`
+            is_global_ref: false,
+        }
+    }
+}
+
+// This is a convenient for `for<'a> impl Into<Symbol> for &'a T`
+pub(crate) trait SymbolLike {
+    fn to_symbol(&self) -> Symbol;
+}
+
+impl SymbolLike for Symbol {
+    fn to_symbol(&self) -> Symbol {
+        *self
+    }
+}
+
\ No newline at end of file diff --git a/docs/src/egglog/value.rs.html b/docs/src/egglog/value.rs.html new file mode 100644 index 00000000..b433676f --- /dev/null +++ b/docs/src/egglog/value.rs.html @@ -0,0 +1,165 @@ +value.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+
use ordered_float::OrderedFloat;
+use std::num::NonZeroU32;
+
+use lazy_static::lazy_static;
+
+use crate::ast::Symbol;
+
+#[cfg(debug_assertions)]
+use crate::{BoolSort, F64Sort, I64Sort, Sort, StringSort};
+
+#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
+// FIXME this shouldn't be pub
+pub struct Value {
+    // since egglog is type-safe, we don't need to store the tag
+    // however, it is useful in debugging, so we keep it in debug builds
+    #[cfg(debug_assertions)]
+    pub tag: Symbol,
+    pub bits: u64,
+}
+
+lazy_static! {
+    static ref BOGUS: Symbol = "__bogus__".into();
+    static ref UNIT: Symbol = "Unit".into();
+}
+
+impl Value {
+    pub fn unit() -> Self {
+        Value {
+            #[cfg(debug_assertions)]
+            tag: *UNIT,
+            bits: 0,
+        }
+    }
+
+    pub fn fake() -> Self {
+        Value {
+            #[cfg(debug_assertions)]
+            tag: *BOGUS,
+            bits: 1234567890,
+        }
+    }
+}
+
+impl From<i64> for Value {
+    fn from(i: i64) -> Self {
+        Self {
+            #[cfg(debug_assertions)]
+            tag: I64Sort.name(),
+            bits: i as u64,
+        }
+    }
+}
+
+impl From<OrderedFloat<f64>> for Value {
+    fn from(f: OrderedFloat<f64>) -> Self {
+        Self {
+            #[cfg(debug_assertions)]
+            tag: F64Sort.name(),
+            bits: f.into_inner().to_bits(),
+        }
+    }
+}
+
+impl From<Symbol> for Value {
+    fn from(s: Symbol) -> Self {
+        Self {
+            #[cfg(debug_assertions)]
+            tag: StringSort.name(),
+            bits: NonZeroU32::from(s).get().into(),
+        }
+    }
+}
+
+impl From<bool> for Value {
+    fn from(b: bool) -> Self {
+        Self {
+            #[cfg(debug_assertions)]
+            tag: BoolSort.name(),
+            bits: b as u64,
+        }
+    }
+}
+
\ No newline at end of file diff --git a/docs/static.files/COPYRIGHT-23e9bde6c69aea69.txt b/docs/static.files/COPYRIGHT-23e9bde6c69aea69.txt new file mode 100644 index 00000000..1447df79 --- /dev/null +++ b/docs/static.files/COPYRIGHT-23e9bde6c69aea69.txt @@ -0,0 +1,50 @@ +# REUSE-IgnoreStart + +These documentation pages include resources by third parties. This copyright +file applies only to those resources. The following third party resources are +included, and carry their own copyright notices and license terms: + +* Fira Sans (FiraSans-Regular.woff2, FiraSans-Medium.woff2): + + Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ + with Reserved Font Name Fira Sans. + + Copyright (c) 2014, Telefonica S.A. + + Licensed under the SIL Open Font License, Version 1.1. + See FiraSans-LICENSE.txt. + +* rustdoc.css, main.js, and playpen.js: + + Copyright 2015 The Rust Developers. + Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or + the MIT license (LICENSE-MIT.txt) at your option. + +* normalize.css: + + Copyright (c) Nicolas Gallagher and Jonathan Neal. + Licensed under the MIT license (see LICENSE-MIT.txt). + +* Source Code Pro (SourceCodePro-Regular.ttf.woff2, + SourceCodePro-Semibold.ttf.woff2, SourceCodePro-It.ttf.woff2): + + Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), + with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark + of Adobe Systems Incorporated in the United States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceCodePro-LICENSE.txt. + +* Source Serif 4 (SourceSerif4-Regular.ttf.woff2, SourceSerif4-Bold.ttf.woff2, + SourceSerif4-It.ttf.woff2): + + Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name + 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United + States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceSerif4-LICENSE.md. + +This copyright file is intended to be distributed with rustdoc output. + +# REUSE-IgnoreEnd diff --git a/docs/static.files/FiraSans-LICENSE-db4b642586e02d97.txt b/docs/static.files/FiraSans-LICENSE-db4b642586e02d97.txt new file mode 100644 index 00000000..d7e9c149 --- /dev/null +++ b/docs/static.files/FiraSans-LICENSE-db4b642586e02d97.txt @@ -0,0 +1,98 @@ +// REUSE-IgnoreStart + +Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A. +with Reserved Font Name < Fira >, + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/docs/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 b/docs/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 new file mode 100644 index 00000000..7a1e5fc5 Binary files /dev/null and b/docs/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 differ diff --git a/docs/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 b/docs/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 new file mode 100644 index 00000000..e766e06c Binary files /dev/null and b/docs/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 differ diff --git a/docs/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt b/docs/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt new file mode 100644 index 00000000..16fe87b0 --- /dev/null +++ b/docs/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/docs/static.files/LICENSE-MIT-65090b722b3f6c56.txt b/docs/static.files/LICENSE-MIT-65090b722b3f6c56.txt new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/docs/static.files/LICENSE-MIT-65090b722b3f6c56.txt @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/docs/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 b/docs/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 new file mode 100644 index 00000000..1866ad4b Binary files /dev/null and b/docs/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 differ diff --git a/docs/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt b/docs/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt new file mode 100644 index 00000000..4b3edc29 --- /dev/null +++ b/docs/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt @@ -0,0 +1,103 @@ +// REUSE-IgnoreStart + +Copyright (c) 2010, NAVER Corporation (https://www.navercorp.com/), + +with Reserved Font Name Nanum, Naver Nanum, NanumGothic, Naver NanumGothic, +NanumMyeongjo, Naver NanumMyeongjo, NanumBrush, Naver NanumBrush, NanumPen, +Naver NanumPen, Naver NanumGothicEco, NanumGothicEco, Naver NanumMyeongjoEco, +NanumMyeongjoEco, Naver NanumGothicLight, NanumGothicLight, NanumBarunGothic, +Naver NanumBarunGothic, NanumSquareRound, NanumBarunPen, MaruBuri + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/docs/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 b/docs/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 new file mode 100644 index 00000000..462c34ef Binary files /dev/null and b/docs/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 differ diff --git a/docs/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt b/docs/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt new file mode 100644 index 00000000..0d2941e1 --- /dev/null +++ b/docs/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt @@ -0,0 +1,97 @@ +// REUSE-IgnoreStart + +Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/docs/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 b/docs/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 new file mode 100644 index 00000000..10b558e0 Binary files /dev/null and b/docs/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 differ diff --git a/docs/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 b/docs/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 new file mode 100644 index 00000000..5ec64eef Binary files /dev/null and b/docs/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 differ diff --git a/docs/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 b/docs/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 new file mode 100644 index 00000000..181a07f6 Binary files /dev/null and b/docs/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 differ diff --git a/docs/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 b/docs/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 new file mode 100644 index 00000000..2ae08a7b Binary files /dev/null and b/docs/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 differ diff --git a/docs/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md b/docs/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md new file mode 100644 index 00000000..175fa4f4 --- /dev/null +++ b/docs/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md @@ -0,0 +1,98 @@ + + +Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. +Copyright 2014 - 2023 Adobe (http://www.adobe.com/), with Reserved Font Name ‘Source’. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + + diff --git a/docs/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 b/docs/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 new file mode 100644 index 00000000..0263fc30 Binary files /dev/null and b/docs/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 differ diff --git a/docs/static.files/clipboard-24048e6d87f63d07.svg b/docs/static.files/clipboard-24048e6d87f63d07.svg new file mode 100644 index 00000000..e437c83f --- /dev/null +++ b/docs/static.files/clipboard-24048e6d87f63d07.svg @@ -0,0 +1 @@ + diff --git a/docs/static.files/favicon-2c020d218678b618.svg b/docs/static.files/favicon-2c020d218678b618.svg new file mode 100644 index 00000000..8b34b511 --- /dev/null +++ b/docs/static.files/favicon-2c020d218678b618.svg @@ -0,0 +1,24 @@ + + + + + diff --git a/docs/static.files/favicon-32x32-422f7d1d52889060.png b/docs/static.files/favicon-32x32-422f7d1d52889060.png new file mode 100644 index 00000000..69b8613c Binary files /dev/null and b/docs/static.files/favicon-32x32-422f7d1d52889060.png differ diff --git a/docs/static.files/main-20a3ad099b048cf2.js b/docs/static.files/main-20a3ad099b048cf2.js new file mode 100644 index 00000000..133116e4 --- /dev/null +++ b/docs/static.files/main-20a3ad099b048cf2.js @@ -0,0 +1,11 @@ +"use strict";window.RUSTDOC_TOOLTIP_HOVER_MS=300;window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS=450;function resourcePath(basename,extension){return getVar("root-path")+basename+getVar("resource-suffix")+extension}function hideMain(){addClass(document.getElementById(MAIN_ID),"hidden")}function showMain(){removeClass(document.getElementById(MAIN_ID),"hidden")}function blurHandler(event,parentElem,hideCallback){if(!parentElem.contains(document.activeElement)&&!parentElem.contains(event.relatedTarget)){hideCallback()}}window.rootPath=getVar("root-path");window.currentCrate=getVar("current-crate");function setMobileTopbar(){const mobileTopbar=document.querySelector(".mobile-topbar");const locationTitle=document.querySelector(".sidebar h2.location");if(mobileTopbar){const mobileTitle=document.createElement("h2");mobileTitle.className="location";if(hasClass(document.querySelector(".rustdoc"),"crate")){mobileTitle.innerHTML=`Crate ${window.currentCrate}`}else if(locationTitle){mobileTitle.innerHTML=locationTitle.innerHTML}mobileTopbar.appendChild(mobileTitle)}}function getVirtualKey(ev){if("key"in ev&&typeof ev.key!=="undefined"){return ev.key}const c=ev.charCode||ev.keyCode;if(c===27){return"Escape"}return String.fromCharCode(c)}const MAIN_ID="main-content";const SETTINGS_BUTTON_ID="settings-menu";const ALTERNATIVE_DISPLAY_ID="alternative-display";const NOT_DISPLAYED_ID="not-displayed";const HELP_BUTTON_ID="help-button";function getSettingsButton(){return document.getElementById(SETTINGS_BUTTON_ID)}function getHelpButton(){return document.getElementById(HELP_BUTTON_ID)}function getNakedUrl(){return window.location.href.split("?")[0].split("#")[0]}function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}function getOrCreateSection(id,classes){let el=document.getElementById(id);if(!el){el=document.createElement("section");el.id=id;el.className=classes;insertAfter(el,document.getElementById(MAIN_ID))}return el}function getAlternativeDisplayElem(){return getOrCreateSection(ALTERNATIVE_DISPLAY_ID,"content hidden")}function getNotDisplayedElem(){return getOrCreateSection(NOT_DISPLAYED_ID,"hidden")}function switchDisplayedElement(elemToDisplay){const el=getAlternativeDisplayElem();if(el.children.length>0){getNotDisplayedElem().appendChild(el.firstElementChild)}if(elemToDisplay===null){addClass(el,"hidden");showMain();return}el.appendChild(elemToDisplay);hideMain();removeClass(el,"hidden")}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function preLoadCss(cssUrl){const link=document.createElement("link");link.href=cssUrl;link.rel="preload";link.as="style";document.getElementsByTagName("head")[0].appendChild(link)}(function(){const isHelpPage=window.location.pathname.endsWith("/help.html");function loadScript(url,errorCallback){const script=document.createElement("script");script.src=url;if(errorCallback!==undefined){script.onerror=errorCallback}document.head.append(script)}getSettingsButton().onclick=event=>{if(event.ctrlKey||event.altKey||event.metaKey){return}window.hideAllModals(false);addClass(getSettingsButton(),"rotate");event.preventDefault();loadScript(getVar("static-root-path")+getVar("settings-js"));setTimeout(()=>{const themes=getVar("themes").split(",");for(const theme of themes){if(theme!==""){preLoadCss(getVar("root-path")+theme+".css")}}},0)};window.searchState={loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:()=>{let el=document.getElementById("search");if(!el){el=document.createElement("section");el.id="search";getNotDisplayedElem().appendChild(el)}return el},title:document.title,titleBeforeSearch:document.title,timeout:null,currentTab:0,focusedByTab:[null,null,null],clearInputTimeout:()=>{if(searchState.timeout!==null){clearTimeout(searchState.timeout);searchState.timeout=null}},isDisplayed:()=>searchState.outputElement().parentElement.id===ALTERNATIVE_DISPLAY_ID,focus:()=>{searchState.input.focus()},defocus:()=>{searchState.input.blur()},showResults:search=>{if(search===null||typeof search==="undefined"){search=searchState.outputElement()}switchDisplayedElement(search);searchState.mouseMovedAfterSearch=false;document.title=searchState.title},removeQueryParameters:()=>{document.title=searchState.titleBeforeSearch;if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.hash)}},hideResults:()=>{switchDisplayedElement(null);searchState.removeQueryParameters()},getQueryStringParams:()=>{const params={};window.location.search.substring(1).split("&").map(s=>{const pair=s.split("=").map(x=>x.replace(/\+/g," "));params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},setup:()=>{const search_input=searchState.input;if(!searchState.input){return}let searchLoaded=false;function sendSearchForm(){document.getElementsByClassName("search-form")[0].submit()}function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(getVar("static-root-path")+getVar("search-js"),sendSearchForm);loadScript(resourcePath("search-index",".js"),sendSearchForm)}}search_input.addEventListener("focus",()=>{search_input.origPlaceholder=search_input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});if(search_input.value!==""){loadSearch()}const params=searchState.getQueryStringParams();if(params.search!==undefined){searchState.setLoadingSearch();loadSearch()}},setLoadingSearch:()=>{const search=searchState.outputElement();search.innerHTML="

"+searchState.loadingText+"

";searchState.showResults(search)},descShards:new Map(),loadDesc:async function({descShard,descIndex}){if(descShard.promise===null){descShard.promise=new Promise((resolve,reject)=>{descShard.resolve=resolve;const ds=descShard;const fname=`${ds.crate}-desc-${ds.shard}-`;const url=resourcePath(`search.desc/${descShard.crate}/${fname}`,".js",);loadScript(url,reject)})}const list=await descShard.promise;return list[descIndex]},loadedDescShard:function(crate,shard,data){this.descShards.get(crate)[shard].resolve(data.split("\n"))},};const toggleAllDocsId="toggle-all-docs";let savedHash="";function handleHashes(ev){if(ev!==null&&searchState.isDisplayed()&&ev.newURL){switchDisplayedElement(null);const hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.search+"#"+hash)}const elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}const pageId=window.location.hash.replace(/^#/,"");if(savedHash!==pageId){savedHash=pageId;if(pageId!==""){expandSection(pageId)}}if(savedHash.startsWith("impl-")){const splitAt=savedHash.indexOf("/");if(splitAt!==-1){const implId=savedHash.slice(0,splitAt);const assocId=savedHash.slice(splitAt+1);const implElem=document.getElementById(implId);if(implElem&&implElem.parentElement.tagName==="SUMMARY"&&implElem.parentElement.parentElement.tagName==="DETAILS"){onEachLazy(implElem.parentElement.parentElement.querySelectorAll(`[id^="${assocId}"]`),item=>{const numbered=/([^-]+)-([0-9]+)/.exec(item.id);if(item.id===assocId||(numbered&&numbered[1]===assocId)){openParentDetails(item);item.scrollIntoView();setTimeout(()=>{window.location.replace("#"+item.id)},0)}},)}}}}function onHashChange(ev){hideSidebar();handleHashes(ev)}function openParentDetails(elem){while(elem){if(elem.tagName==="DETAILS"){elem.open=true}elem=elem.parentNode}}function expandSection(id){openParentDetails(document.getElementById(id))}function handleEscape(ev){searchState.clearInputTimeout();searchState.hideResults();ev.preventDefault();searchState.defocus();window.hideAllModals(true)}function handleShortcut(ev){const disableShortcuts=getSettingValue("disable-shortcuts")==="true";if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts){return}if(document.activeElement.tagName==="INPUT"&&document.activeElement.type!=="checkbox"&&document.activeElement.type!=="radio"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":case"/":ev.preventDefault();searchState.focus();break;case"+":ev.preventDefault();expandAllDocs();break;case"-":ev.preventDefault();collapseAllDocs();break;case"?":showHelp();break;default:break}}}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);function addSidebarItems(){if(!window.SIDEBAR_ITEMS){return}const sidebar=document.getElementsByClassName("sidebar-elems")[0];function block(shortty,id,longty){const filtered=window.SIDEBAR_ITEMS[shortty];if(!filtered){return}const modpath=hasClass(document.querySelector(".rustdoc"),"mod")?"../":"";const h3=document.createElement("h3");h3.innerHTML=`${longty}`;const ul=document.createElement("ul");ul.className="block "+shortty;for(const name of filtered){let path;if(shortty==="mod"){path=`${modpath}${name}/index.html`}else{path=`${modpath}${shortty}.${name}.html`}let current_page=document.location.href.toString();if(current_page.endsWith("/")){current_page+="index.html"}const link=document.createElement("a");link.href=path;if(path===current_page){link.className="current"}link.textContent=name;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebar.appendChild(h3);sidebar.appendChild(ul)}if(sidebar){block("primitive","primitives","Primitive Types");block("mod","modules","Modules");block("macro","macros","Macros");block("struct","structs","Structs");block("enum","enums","Enums");block("constant","constants","Constants");block("static","static","Statics");block("trait","traits","Traits");block("fn","functions","Functions");block("type","types","Type Aliases");block("union","unions","Unions");block("foreigntype","foreign-types","Foreign Types");block("keyword","keywords","Keywords");block("opaque","opaque-types","Opaque Types");block("attr","attributes","Attribute Macros");block("derive","derives","Derive Macros");block("traitalias","trait-aliases","Trait Aliases")}}window.register_implementors=imp=>{const implementors=document.getElementById("implementors-list");const synthetic_implementors=document.getElementById("synthetic-implementors-list");const inlined_types=new Set();const TEXT_IDX=0;const SYNTHETIC_IDX=1;const TYPES_IDX=2;if(synthetic_implementors){onEachLazy(synthetic_implementors.getElementsByClassName("impl"),el=>{const aliases=el.getAttribute("data-aliases");if(!aliases){return}aliases.split(",").forEach(alias=>{inlined_types.add(alias)})})}let currentNbImpls=implementors.getElementsByClassName("impl").length;const traitName=document.querySelector(".main-heading h1 > .trait").textContent;const baseIdName="impl-"+traitName+"-";const libs=Object.getOwnPropertyNames(imp);const script=document.querySelector("script[data-ignore-extern-crates]");const ignoreExternCrates=new Set((script?script.getAttribute("data-ignore-extern-crates"):"").split(","),);for(const lib of libs){if(lib===window.currentCrate||ignoreExternCrates.has(lib)){continue}const structs=imp[lib];struct_loop:for(const struct of structs){const list=struct[SYNTHETIC_IDX]?synthetic_implementors:implementors;if(struct[SYNTHETIC_IDX]){for(const struct_type of struct[TYPES_IDX]){if(inlined_types.has(struct_type)){continue struct_loop}inlined_types.add(struct_type)}}const code=document.createElement("h3");code.innerHTML=struct[TEXT_IDX];addClass(code,"code-header");onEachLazy(code.getElementsByTagName("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});const currentId=baseIdName+currentNbImpls;const anchor=document.createElement("a");anchor.href="#"+currentId;addClass(anchor,"anchor");const display=document.createElement("div");display.id=currentId;addClass(display,"impl");display.appendChild(anchor);display.appendChild(code);list.appendChild(display);currentNbImpls+=1}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}window.register_type_impls=imp=>{if(!imp||!imp[window.currentCrate]){return}window.pending_type_impls=null;const idMap=new Map();let implementations=document.getElementById("implementations-list");let trait_implementations=document.getElementById("trait-implementations-list");let trait_implementations_header=document.getElementById("trait-implementations");const script=document.querySelector("script[data-self-path]");const selfPath=script?script.getAttribute("data-self-path"):null;const mainContent=document.querySelector("#main-content");const sidebarSection=document.querySelector(".sidebar section");let methods=document.querySelector(".sidebar .block.method");let associatedTypes=document.querySelector(".sidebar .block.associatedtype");let associatedConstants=document.querySelector(".sidebar .block.associatedconstant");let sidebarTraitList=document.querySelector(".sidebar .block.trait-implementation");for(const impList of imp[window.currentCrate]){const types=impList.slice(2);const text=impList[0];const isTrait=impList[1]!==0;const traitName=impList[1];if(types.indexOf(selfPath)===-1){continue}let outputList=isTrait?trait_implementations:implementations;if(outputList===null){const outputListName=isTrait?"Trait Implementations":"Implementations";const outputListId=isTrait?"trait-implementations-list":"implementations-list";const outputListHeaderId=isTrait?"trait-implementations":"implementations";const outputListHeader=document.createElement("h2");outputListHeader.id=outputListHeaderId;outputListHeader.innerText=outputListName;outputList=document.createElement("div");outputList.id=outputListId;if(isTrait){const link=document.createElement("a");link.href=`#${outputListHeaderId}`;link.innerText="Trait Implementations";const h=document.createElement("h3");h.appendChild(link);trait_implementations=outputList;trait_implementations_header=outputListHeader;sidebarSection.appendChild(h);sidebarTraitList=document.createElement("ul");sidebarTraitList.className="block trait-implementation";sidebarSection.appendChild(sidebarTraitList);mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}else{implementations=outputList;if(trait_implementations){mainContent.insertBefore(outputListHeader,trait_implementations_header);mainContent.insertBefore(outputList,trait_implementations_header)}else{const mainContent=document.querySelector("#main-content");mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}}}const template=document.createElement("template");template.innerHTML=text;onEachLazy(template.content.querySelectorAll("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});onEachLazy(template.content.querySelectorAll("[id]"),el=>{let i=0;if(idMap.has(el.id)){i=idMap.get(el.id)}else if(document.getElementById(el.id)){i=1;while(document.getElementById(`${el.id}-${2 * i}`)){i=2*i}while(document.getElementById(`${el.id}-${i}`)){i+=1}}if(i!==0){const oldHref=`#${el.id}`;const newHref=`#${el.id}-${i}`;el.id=`${el.id}-${i}`;onEachLazy(template.content.querySelectorAll("a[href]"),link=>{if(link.getAttribute("href")===oldHref){link.href=newHref}})}idMap.set(el.id,i+1)});const templateAssocItems=template.content.querySelectorAll("section.tymethod, "+"section.method, section.associatedtype, section.associatedconstant");if(isTrait){const li=document.createElement("li");const a=document.createElement("a");a.href=`#${template.content.querySelector(".impl").id}`;a.textContent=traitName;li.appendChild(a);sidebarTraitList.append(li)}else{onEachLazy(templateAssocItems,item=>{let block=hasClass(item,"associatedtype")?associatedTypes:(hasClass(item,"associatedconstant")?associatedConstants:(methods));if(!block){const blockTitle=hasClass(item,"associatedtype")?"Associated Types":(hasClass(item,"associatedconstant")?"Associated Constants":("Methods"));const blockClass=hasClass(item,"associatedtype")?"associatedtype":(hasClass(item,"associatedconstant")?"associatedconstant":("method"));const blockHeader=document.createElement("h3");const blockLink=document.createElement("a");blockLink.href="#implementations";blockLink.innerText=blockTitle;blockHeader.appendChild(blockLink);block=document.createElement("ul");block.className=`block ${blockClass}`;const insertionReference=methods||sidebarTraitList;if(insertionReference){const insertionReferenceH=insertionReference.previousElementSibling;sidebarSection.insertBefore(blockHeader,insertionReferenceH);sidebarSection.insertBefore(block,insertionReferenceH)}else{sidebarSection.appendChild(blockHeader);sidebarSection.appendChild(block)}if(hasClass(item,"associatedtype")){associatedTypes=block}else if(hasClass(item,"associatedconstant")){associatedConstants=block}else{methods=block}}const li=document.createElement("li");const a=document.createElement("a");a.innerText=item.id.split("-")[0].split(".")[1];a.href=`#${item.id}`;li.appendChild(a);block.appendChild(li)})}outputList.appendChild(template.content)}for(const list of[methods,associatedTypes,associatedConstants,sidebarTraitList]){if(!list){continue}const newChildren=Array.prototype.slice.call(list.children);newChildren.sort((a,b)=>{const aI=a.innerText;const bI=b.innerText;return aIbI?1:0});list.replaceChildren(...newChildren)}};if(window.pending_type_impls){window.register_type_impls(window.pending_type_impls)}function addSidebarCrates(){if(!window.ALL_CRATES){return}const sidebarElems=document.getElementsByClassName("sidebar-elems")[0];if(!sidebarElems){return}const h3=document.createElement("h3");h3.innerHTML="Crates";const ul=document.createElement("ul");ul.className="block crate";for(const crate of window.ALL_CRATES){const link=document.createElement("a");link.href=window.rootPath+crate+"/index.html";link.textContent=crate;const li=document.createElement("li");if(window.rootPath!=="./"&&crate===window.currentCrate){li.className="current"}li.appendChild(link);ul.appendChild(li)}sidebarElems.appendChild(h3);sidebarElems.appendChild(ul)}function expandAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);removeClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hasClass(e,"type-contents-toggle")&&!hasClass(e,"more-examples-toggle")){e.open=true}});innerToggle.title="collapse all docs";innerToggle.children[0].innerText="\u2212"}function collapseAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);addClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(e.parentNode.id!=="implementations-list"||(!hasClass(e,"implementors-toggle")&&!hasClass(e,"type-contents-toggle"))){e.open=false}});innerToggle.title="expand all docs";innerToggle.children[0].innerText="+"}function toggleAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);if(!innerToggle){return}if(hasClass(innerToggle,"will-expand")){expandAllDocs()}else{collapseAllDocs()}}(function(){const toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}const hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";const hideImplementations=getSettingValue("auto-hide-trait-implementations")==="true";const hideLargeItemContents=getSettingValue("auto-hide-large-items")!=="false";function setImplementorsTogglesOpen(id,open){const list=document.getElementById(id);if(list!==null){onEachLazy(list.getElementsByClassName("implementors-toggle"),e=>{e.open=open})}}if(hideImplementations){setImplementorsTogglesOpen("trait-implementations-list",false);setImplementorsTogglesOpen("blanket-implementations-list",false)}onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hideLargeItemContents&&hasClass(e,"type-contents-toggle")){e.open=true}if(hideMethodDocs&&hasClass(e,"method-toggle")){e.open=false}})}());window.rustdoc_add_line_numbers_to_examples=()=>{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");if(line_numbers.length>0){return}const count=x.textContent.split("\n").length;const elems=[];for(let i=0;i{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");for(const node of line_numbers){parent.removeChild(node)}})};if(getSettingValue("line-numbers")==="true"){window.rustdoc_add_line_numbers_to_examples()}function showSidebar(){window.hideAllModals(false);const sidebar=document.getElementsByClassName("sidebar")[0];addClass(sidebar,"shown")}function hideSidebar(){const sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"shown")}window.addEventListener("resize",()=>{if(window.CURRENT_TOOLTIP_ELEMENT){const base=window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE;const force_visible=base.TOOLTIP_FORCE_VISIBLE;hideTooltip(false);if(force_visible){showTooltip(base);base.TOOLTIP_FORCE_VISIBLE=true}}});const mainElem=document.getElementById(MAIN_ID);if(mainElem){mainElem.addEventListener("click",hideSidebar)}onEachLazy(document.querySelectorAll("a[href^='#']"),el=>{el.addEventListener("click",()=>{expandSection(el.hash.slice(1));hideSidebar()})});onEachLazy(document.querySelectorAll(".toggle > summary:not(.hideme)"),el=>{el.addEventListener("click",e=>{if(e.target.tagName!=="SUMMARY"&&e.target.tagName!=="A"){e.preventDefault()}})});function showTooltip(e){const notable_ty=e.getAttribute("data-notable-ty");if(!window.NOTABLE_TRAITS&¬able_ty){const data=document.getElementById("notable-traits-data");if(data){window.NOTABLE_TRAITS=JSON.parse(data.innerText)}else{throw new Error("showTooltip() called with notable without any notable traits!")}}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE===e){clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);return}window.hideAllModals(false);const wrapper=document.createElement("div");if(notable_ty){wrapper.innerHTML="
"+window.NOTABLE_TRAITS[notable_ty]+"
"}else{if(e.getAttribute("title")!==null){e.setAttribute("data-title",e.getAttribute("title"));e.removeAttribute("title")}if(e.getAttribute("data-title")!==null){const titleContent=document.createElement("div");titleContent.className="content";titleContent.appendChild(document.createTextNode(e.getAttribute("data-title")));wrapper.appendChild(titleContent)}}wrapper.className="tooltip popover";const focusCatcher=document.createElement("div");focusCatcher.setAttribute("tabindex","0");focusCatcher.onfocus=hideTooltip;wrapper.appendChild(focusCatcher);const pos=e.getBoundingClientRect();wrapper.style.top=(pos.top+window.scrollY+pos.height)+"px";wrapper.style.left=0;wrapper.style.right="auto";wrapper.style.visibility="hidden";const body=document.getElementsByTagName("body")[0];body.appendChild(wrapper);const wrapperPos=wrapper.getBoundingClientRect();const finalPos=pos.left+window.scrollX-wrapperPos.width+24;if(finalPos>0){wrapper.style.left=finalPos+"px"}else{wrapper.style.setProperty("--popover-arrow-offset",(wrapperPos.right-pos.right+4)+"px",)}wrapper.style.visibility="";window.CURRENT_TOOLTIP_ELEMENT=wrapper;window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE=e;clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);wrapper.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}clearTooltipHoverTimeout(e)};wrapper.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&!e.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(wrapper,"fade-out")}}}function setTooltipHoverTimeout(element,show){clearTooltipHoverTimeout(element);if(!show&&!window.CURRENT_TOOLTIP_ELEMENT){return}if(show&&window.CURRENT_TOOLTIP_ELEMENT){return}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE!==element){return}element.TOOLTIP_HOVER_TIMEOUT=setTimeout(()=>{if(show){showTooltip(element)}else if(!element.TOOLTIP_FORCE_VISIBLE){hideTooltip(false)}},show?window.RUSTDOC_TOOLTIP_HOVER_MS:window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS)}function clearTooltipHoverTimeout(element){if(element.TOOLTIP_HOVER_TIMEOUT!==undefined){removeClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out");clearTimeout(element.TOOLTIP_HOVER_TIMEOUT);delete element.TOOLTIP_HOVER_TIMEOUT}}function tooltipBlurHandler(event){if(window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.contains(event.relatedTarget)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(event.relatedTarget)){setTimeout(()=>hideTooltip(false),0)}}function hideTooltip(focus){if(window.CURRENT_TOOLTIP_ELEMENT){if(window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE){if(focus){window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.focus()}window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE=false}const body=document.getElementsByTagName("body")[0];body.removeChild(window.CURRENT_TOOLTIP_ELEMENT);clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);window.CURRENT_TOOLTIP_ELEMENT=null}}onEachLazy(document.getElementsByClassName("tooltip"),e=>{e.onclick=()=>{e.TOOLTIP_FORCE_VISIBLE=e.TOOLTIP_FORCE_VISIBLE?false:true;if(window.CURRENT_TOOLTIP_ELEMENT&&!e.TOOLTIP_FORCE_VISIBLE){hideTooltip(true)}else{showTooltip(e);window.CURRENT_TOOLTIP_ELEMENT.setAttribute("tabindex","0");window.CURRENT_TOOLTIP_ELEMENT.focus();window.CURRENT_TOOLTIP_ELEMENT.onblur=tooltipBlurHandler}return false};e.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointermove=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out")}}});const sidebar_menu_toggle=document.getElementsByClassName("sidebar-menu-toggle")[0];if(sidebar_menu_toggle){sidebar_menu_toggle.addEventListener("click",()=>{const sidebar=document.getElementsByClassName("sidebar")[0];if(!hasClass(sidebar,"shown")){showSidebar()}else{hideSidebar()}})}function helpBlurHandler(event){blurHandler(event,getHelpButton(),window.hidePopoverMenus)}function buildHelpMenu(){const book_info=document.createElement("span");const channel=getVar("channel");book_info.className="top";book_info.innerHTML=`You can find more information in \ +the rustdoc book.`;const shortcuts=[["?","Show this help dialog"],["S / /","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"
"+x[0].split(" ").map((y,index)=>((index&1)===0?""+y+"":" "+y+" ")).join("")+"
"+x[1]+"
").join("");const div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";const infos=[`For a full list of all search features, take a look here.`,"Prefix searches with a type followed by a colon (e.g., fn:) to \ + restrict the search to a given item kind.","Accepted kinds are: fn, mod, struct, \ + enum, trait, type, macro, \ + and const.","Search functions by type signature (e.g., vec -> usize or \ + -> vec or String, enum:Cow -> bool)","You can look for items with an exact name by putting double quotes around \ + your request: \"string\"","Look for functions that accept or return \ + slices and \ + arrays by writing \ + square brackets (e.g., -> [u8] or [] -> Option)","Look for items inside another one by searching for a path: vec::Vec",].map(x=>"

"+x+"

").join("");const div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;const rustdoc_version=document.createElement("span");rustdoc_version.className="bottom";const rustdoc_version_code=document.createElement("code");rustdoc_version_code.innerText="rustdoc "+getVar("rustdoc-version");rustdoc_version.appendChild(rustdoc_version_code);const container=document.createElement("div");if(!isHelpPage){container.className="popover"}container.id="help";container.style.display="none";const side_by_side=document.createElement("div");side_by_side.className="side-by-side";side_by_side.appendChild(div_shortcuts);side_by_side.appendChild(div_infos);container.appendChild(book_info);container.appendChild(side_by_side);container.appendChild(rustdoc_version);if(isHelpPage){const help_section=document.createElement("section");help_section.appendChild(container);document.getElementById("main-content").appendChild(help_section);container.style.display="block"}else{const help_button=getHelpButton();help_button.appendChild(container);container.onblur=helpBlurHandler;help_button.onblur=helpBlurHandler;help_button.children[0].onblur=helpBlurHandler}return container}window.hideAllModals=switchFocus=>{hideSidebar();window.hidePopoverMenus();hideTooltip(switchFocus)};window.hidePopoverMenus=()=>{onEachLazy(document.querySelectorAll(".search-form .popover"),elem=>{elem.style.display="none"})};function getHelpMenu(buildNeeded){let menu=getHelpButton().querySelector(".popover");if(!menu&&buildNeeded){menu=buildHelpMenu()}return menu}function showHelp(){getHelpButton().querySelector("a").focus();const menu=getHelpMenu(true);if(menu.style.display==="none"){window.hideAllModals();menu.style.display=""}}if(isHelpPage){showHelp();document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault()})}else{document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault();const menu=getHelpMenu(true);const shouldShowHelp=menu.style.display==="none";if(shouldShowHelp){showHelp()}else{window.hidePopoverMenus()}})}setMobileTopbar();addSidebarItems();addSidebarCrates();onHashChange(null);window.addEventListener("hashchange",onHashChange);searchState.setup()}());(function(){const SIDEBAR_MIN=100;const SIDEBAR_MAX=500;const RUSTDOC_MOBILE_BREAKPOINT=700;const BODY_MIN=400;const SIDEBAR_VANISH_THRESHOLD=SIDEBAR_MIN/2;const sidebarButton=document.getElementById("sidebar-button");if(sidebarButton){sidebarButton.addEventListener("click",e=>{removeClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","false");if(document.querySelector(".rustdoc.src")){window.rustdocToggleSrcSidebar()}e.preventDefault()})}let currentPointerId=null;let desiredSidebarSize=null;let pendingSidebarResizingFrame=false;const resizer=document.querySelector(".sidebar-resizer");const sidebar=document.querySelector(".sidebar");if(!resizer||!sidebar){return}const isSrcPage=hasClass(document.body,"src");function hideSidebar(){if(isSrcPage){window.rustdocCloseSourceSidebar();updateLocalStorage("src-sidebar-width",null);document.documentElement.style.removeProperty("--src-sidebar-width");sidebar.style.removeProperty("--src-sidebar-width");resizer.style.removeProperty("--src-sidebar-width")}else{addClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","true");updateLocalStorage("desktop-sidebar-width",null);document.documentElement.style.removeProperty("--desktop-sidebar-width");sidebar.style.removeProperty("--desktop-sidebar-width");resizer.style.removeProperty("--desktop-sidebar-width")}}function showSidebar(){if(isSrcPage){window.rustdocShowSourceSidebar()}else{removeClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","false")}}function changeSidebarSize(size){if(isSrcPage){updateLocalStorage("src-sidebar-width",size);sidebar.style.setProperty("--src-sidebar-width",size+"px");resizer.style.setProperty("--src-sidebar-width",size+"px")}else{updateLocalStorage("desktop-sidebar-width",size);sidebar.style.setProperty("--desktop-sidebar-width",size+"px");resizer.style.setProperty("--desktop-sidebar-width",size+"px")}}function isSidebarHidden(){return isSrcPage?!hasClass(document.documentElement,"src-sidebar-expanded"):hasClass(document.documentElement,"hide-sidebar")}function resize(e){if(currentPointerId===null||currentPointerId!==e.pointerId){return}e.preventDefault();const pos=e.clientX-3;if(pos=SIDEBAR_MIN){if(isSidebarHidden()){showSidebar()}const constrainedPos=Math.min(pos,window.innerWidth-BODY_MIN,SIDEBAR_MAX);changeSidebarSize(constrainedPos);desiredSidebarSize=constrainedPos;if(pendingSidebarResizingFrame!==false){clearTimeout(pendingSidebarResizingFrame)}pendingSidebarResizingFrame=setTimeout(()=>{if(currentPointerId===null||pendingSidebarResizingFrame===false){return}pendingSidebarResizingFrame=false;document.documentElement.style.setProperty("--resizing-sidebar-width",desiredSidebarSize+"px",)},100)}}window.addEventListener("resize",()=>{if(window.innerWidth=(window.innerWidth-BODY_MIN)){changeSidebarSize(window.innerWidth-BODY_MIN)}else if(desiredSidebarSize!==null&&desiredSidebarSize>SIDEBAR_MIN){changeSidebarSize(desiredSidebarSize)}});function stopResize(e){if(currentPointerId===null){return}if(e){e.preventDefault()}desiredSidebarSize=sidebar.getBoundingClientRect().width;removeClass(resizer,"active");window.removeEventListener("pointermove",resize,false);window.removeEventListener("pointerup",stopResize,false);removeClass(document.documentElement,"sidebar-resizing");document.documentElement.style.removeProperty("--resizing-sidebar-width");if(resizer.releasePointerCapture){resizer.releasePointerCapture(currentPointerId);currentPointerId=null}}function initResize(e){if(currentPointerId!==null||e.altKey||e.ctrlKey||e.metaKey||e.button!==0){return}if(resizer.setPointerCapture){resizer.setPointerCapture(e.pointerId);if(!resizer.hasPointerCapture(e.pointerId)){resizer.releasePointerCapture(e.pointerId);return}currentPointerId=e.pointerId}window.hideAllModals(false);e.preventDefault();window.addEventListener("pointermove",resize,false);window.addEventListener("pointercancel",stopResize,false);window.addEventListener("pointerup",stopResize,false);addClass(resizer,"active");addClass(document.documentElement,"sidebar-resizing");const pos=e.clientX-sidebar.offsetLeft-3;document.documentElement.style.setProperty("--resizing-sidebar-width",pos+"px");desiredSidebarSize=null}resizer.addEventListener("pointerdown",initResize,false)}());(function(){let reset_button_timeout=null;const but=document.getElementById("copy-path");if(!but){return}but.onclick=()=>{const parent=but.parentElement;const path=[];onEach(parent.childNodes,child=>{if(child.tagName==="A"){path.push(child.textContent)}});const el=document.createElement("textarea");el.value=path.join("::");el.setAttribute("readonly","");el.style.position="absolute";el.style.left="-9999px";document.body.appendChild(el);el.select();document.execCommand("copy");document.body.removeChild(el);but.classList.add("clicked");if(reset_button_timeout!==null){window.clearTimeout(reset_button_timeout)}function reset_button(){reset_button_timeout=null;but.classList.remove("clicked")}reset_button_timeout=window.setTimeout(reset_button,1000)}}()) \ No newline at end of file diff --git a/docs/static.files/normalize-76eba96aa4d2e634.css b/docs/static.files/normalize-76eba96aa4d2e634.css new file mode 100644 index 00000000..469959f1 --- /dev/null +++ b/docs/static.files/normalize-76eba96aa4d2e634.css @@ -0,0 +1,2 @@ + /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ +html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type="button"],[type="reset"],[type="submit"],button{-webkit-appearance:button}[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} \ No newline at end of file diff --git a/docs/static.files/noscript-09095024cf37855e.css b/docs/static.files/noscript-09095024cf37855e.css new file mode 100644 index 00000000..59786941 --- /dev/null +++ b/docs/static.files/noscript-09095024cf37855e.css @@ -0,0 +1 @@ + #main-content .attributes{margin-left:0 !important;}#copy-path,#sidebar-button,.sidebar-resizer{display:none !important;}nav.sub{display:none;}.src .sidebar{display:none;}.notable-traits{display:none;}:root,:root:not([data-theme]){--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--sidebar-background-color:#f5f5f5;--sidebar-background-color-hover:#e0e0e0;--code-block-background-color:#f5f5f5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--mobile-sidebar-menu-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);--sidebar-resizer-hover:hsl(207,90%,66%);--sidebar-resizer-active:hsl(207,90%,54%);}@media (prefers-color-scheme:dark){:root,:root:not([data-theme]){--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--mobile-sidebar-menu-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);--sidebar-resizer-hover:hsl(207,30%,54%);--sidebar-resizer-active:hsl(207,90%,54%);}} \ No newline at end of file diff --git a/docs/static.files/rust-logo-151179464ae7ed46.svg b/docs/static.files/rust-logo-151179464ae7ed46.svg new file mode 100644 index 00000000..62424d8f --- /dev/null +++ b/docs/static.files/rust-logo-151179464ae7ed46.svg @@ -0,0 +1,61 @@ + + + diff --git a/docs/static.files/rustdoc-081576b923113409.css b/docs/static.files/rustdoc-081576b923113409.css new file mode 100644 index 00000000..33b69caa --- /dev/null +++ b/docs/static.files/rustdoc-081576b923113409.css @@ -0,0 +1,27 @@ + :root{--nav-sub-mobile-padding:8px;--search-typename-width:6.75rem;--desktop-sidebar-width:200px;--src-sidebar-width:300px;--desktop-sidebar-z-index:100;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular-018c141bf0843ffd.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium-8f9a781e4970d388.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:400;src:local('Source Serif 4'),url("SourceSerif4-Regular-46f98efaafac5295.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:italic;font-weight:400;src:local('Source Serif 4 Italic'),url("SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:700;src:local('Source Serif 4 Bold'),url("SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:italic;font-weight:400;src:url("SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'NanumBarunGothic';src:url("NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2") format("woff2");font-display:swap;unicode-range:U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF;}*{box-sizing:border-box;}body{font:1rem/1.5 "Source Serif 4",NanumBarunGothic,serif;margin:0;position:relative;overflow-wrap:break-word;overflow-wrap:anywhere;font-feature-settings:"kern","liga";background-color:var(--main-background-color);color:var(--main-color);}h1{font-size:1.5rem;}h2{font-size:1.375rem;}h3{font-size:1.25rem;}h1,h2,h3,h4,h5,h6{font-weight:500;}h1,h2,h3,h4{margin:25px 0 15px 0;padding-bottom:6px;}.docblock h3,.docblock h4,h5,h6{margin:15px 0 5px 0;}.docblock>h2:first-child,.docblock>h3:first-child,.docblock>h4:first-child,.docblock>h5:first-child,.docblock>h6:first-child{margin-top:0;}.main-heading h1{margin:0;padding:0;flex-grow:1;overflow-wrap:break-word;overflow-wrap:anywhere;}.main-heading{display:flex;flex-wrap:wrap;padding-bottom:6px;margin-bottom:15px;}.content h2,.top-doc .docblock>h3,.top-doc .docblock>h4{border-bottom:1px solid var(--headings-border-bottom-color);}h1,h2{line-height:1.25;padding-top:3px;padding-bottom:9px;}h3.code-header{font-size:1.125rem;}h4.code-header{font-size:1rem;}.code-header{font-weight:600;margin:0;padding:0;white-space:pre-wrap;}#crate-search,h1,h2,h3,h4,h5,h6,.sidebar,.mobile-topbar,.search-input,.search-results .result-name,.item-name>a,.out-of-band,span.since,a.src,#help-button>a,summary.hideme,.scraped-example-list,ul.all-items{font-family:"Fira Sans",Arial,NanumBarunGothic,sans-serif;}#toggle-all-docs,a.anchor,.section-header a,#src-sidebar a,.rust a,.sidebar h2 a,.sidebar h3 a,.mobile-topbar h2 a,h1 a,.search-results a,.stab,.result-name i{color:var(--main-color);}span.enum,a.enum,span.struct,a.struct,span.union,a.union,span.primitive,a.primitive,span.type,a.type,span.foreigntype,a.foreigntype{color:var(--type-link-color);}span.trait,a.trait,span.traitalias,a.traitalias{color:var(--trait-link-color);}span.associatedtype,a.associatedtype,span.constant,a.constant,span.static,a.static{color:var(--assoc-item-link-color);}span.fn,a.fn,span.method,a.method,span.tymethod,a.tymethod{color:var(--function-link-color);}span.attr,a.attr,span.derive,a.derive,span.macro,a.macro{color:var(--macro-link-color);}span.mod,a.mod{color:var(--mod-link-color);}span.keyword,a.keyword{color:var(--keyword-link-color);}a{color:var(--link-color);text-decoration:none;}ol,ul{padding-left:24px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.625em;}p,.docblock>.warning{margin:0 0 .75em 0;}p:last-child,.docblock>.warning:last-child{margin:0;}button{padding:1px 6px;cursor:pointer;}button#toggle-all-docs{padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.rustdoc{display:flex;flex-direction:row;flex-wrap:nowrap;}main{position:relative;flex-grow:1;padding:10px 15px 40px 45px;min-width:0;}.src main{padding:15px;}.width-limiter{max-width:960px;margin-right:auto;}details:not(.toggle) summary{margin-bottom:.6em;}code,pre,a.test-arrow,.code-header{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.125em;}.docblock pre code,.docblock-short pre code{padding:0;}pre{padding:14px;line-height:1.5;}pre.item-decl{overflow-x:auto;}.item-decl .type-contents-toggle{contain:initial;}.src .content pre{padding:20px;}.rustdoc.src .example-wrap pre.src-line-numbers{padding:20px 0 20px 4px;}img{max-width:100%;}.logo-container{line-height:0;display:block;}.rust-logo{filter:var(--rust-logo-filter);}.sidebar{font-size:0.875rem;flex:0 0 var(--desktop-sidebar-width);width:var(--desktop-sidebar-width);overflow-y:scroll;overscroll-behavior:contain;position:sticky;height:100vh;top:0;left:0;z-index:var(--desktop-sidebar-z-index);}.rustdoc.src .sidebar{flex-basis:50px;width:50px;border-right:1px solid;overflow-x:hidden;overflow-y:hidden;}.hide-sidebar .sidebar,.hide-sidebar .sidebar-resizer{display:none;}.sidebar-resizer{touch-action:none;width:9px;cursor:col-resize;z-index:calc(var(--desktop-sidebar-z-index) + 1);position:fixed;height:100%;left:calc(var(--desktop-sidebar-width) + 1px);}.rustdoc.src .sidebar-resizer{left:49px;}.src-sidebar-expanded .src .sidebar-resizer{left:var(--src-sidebar-width);}.sidebar-resizing{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.sidebar-resizing*{cursor:col-resize !important;}.sidebar-resizing .sidebar{position:fixed;}.sidebar-resizing>body{padding-left:var(--resizing-sidebar-width);}.sidebar-resizer:hover,.sidebar-resizer:active,.sidebar-resizer:focus,.sidebar-resizer.active{width:10px;margin:0;left:var(--desktop-sidebar-width);border-left:solid 1px var(--sidebar-resizer-hover);}.src-sidebar-expanded .rustdoc.src .sidebar-resizer:hover,.src-sidebar-expanded .rustdoc.src .sidebar-resizer:active,.src-sidebar-expanded .rustdoc.src .sidebar-resizer:focus,.src-sidebar-expanded .rustdoc.src .sidebar-resizer.active{left:calc(var(--src-sidebar-width) - 1px);}@media (pointer:coarse){.sidebar-resizer{display:none !important;}}.sidebar-resizer.active{padding:0 140px;width:2px;margin-left:-140px;border-left:none;}.sidebar-resizer.active:before{border-left:solid 2px var(--sidebar-resizer-active);display:block;height:100%;content:"";}.sidebar,.mobile-topbar,.sidebar-menu-toggle,#src-sidebar{background-color:var(--sidebar-background-color);}.src .sidebar>*{visibility:hidden;}.src-sidebar-expanded .src .sidebar{overflow-y:auto;flex-basis:var(--src-sidebar-width);width:var(--src-sidebar-width);}.src-sidebar-expanded .src .sidebar>*{visibility:visible;}#all-types{margin-top:1em;}*{scrollbar-width:initial;scrollbar-color:var(--scrollbar-color);}.sidebar{scrollbar-width:thin;scrollbar-color:var(--scrollbar-color);}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;background-color:var(--scrollbar-track-background-color);}.sidebar::-webkit-scrollbar-track{background-color:var(--scrollbar-track-background-color);}::-webkit-scrollbar-thumb,.sidebar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-background-color);}.hidden{display:none !important;}.logo-container>img{height:48px;width:48px;}ul.block,.block li{padding:0;margin:0;list-style:none;}.sidebar-elems a,.sidebar>h2 a{display:block;padding:0.25rem;margin-left:-0.25rem;margin-right:0.25rem;}.sidebar h2{overflow-wrap:anywhere;padding:0;margin:0.7rem 0;}.sidebar h3{font-size:1.125rem;padding:0;margin:0;}.sidebar-elems,.sidebar>.version,.sidebar>h2{padding-left:24px;}.sidebar a{color:var(--sidebar-link-color);}.sidebar .current,.sidebar .current a,.sidebar-crate a.logo-container:hover+h2 a,.sidebar a:hover:not(.logo-container){background-color:var(--sidebar-current-link-background-color);}.sidebar-elems .block{margin-bottom:2em;}.sidebar-elems .block li a{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}.sidebar-crate{display:flex;align-items:center;justify-content:center;margin:14px 32px 1rem;row-gap:10px;column-gap:32px;flex-wrap:wrap;}.sidebar-crate h2{flex-grow:1;margin:0 -8px;align-self:start;}.sidebar-crate .logo-container{margin:0 -16px 0 -16px;text-align:center;}.sidebar-crate h2 a{display:block;margin:0 calc(-24px + 0.25rem) 0 -0.2rem;padding:calc((16px - 0.57rem ) / 2 ) 0.25rem;padding-left:0.2rem;}.sidebar-crate h2 .version{display:block;font-weight:normal;font-size:1rem;overflow-wrap:break-word;}.sidebar-crate+.version{margin-top:-1rem;margin-bottom:1rem;}.mobile-topbar{display:none;}.rustdoc .example-wrap{display:flex;position:relative;margin-bottom:10px;}.rustdoc .example-wrap:last-child{margin-bottom:0px;}.rustdoc .example-wrap pre{margin:0;flex-grow:1;}.rustdoc:not(.src) .example-wrap pre{overflow:auto hidden;}.rustdoc .example-wrap pre.example-line-numbers,.rustdoc .example-wrap pre.src-line-numbers{flex-grow:0;min-width:fit-content;overflow:initial;text-align:right;-webkit-user-select:none;user-select:none;padding:14px 8px;color:var(--src-line-numbers-span-color);}.rustdoc .example-wrap pre.src-line-numbers{padding:14px 0;}.src-line-numbers a,.src-line-numbers span{color:var(--src-line-numbers-span-color);padding:0 8px;}.src-line-numbers :target{background-color:transparent;border-right:none;padding:0 8px;}.src-line-numbers .line-highlighted{background-color:var(--src-line-number-highlighted-background-color);}.search-loading{text-align:center;}.docblock-short{overflow-wrap:break-word;overflow-wrap:anywhere;}.docblock :not(pre)>code,.docblock-short code{white-space:pre-wrap;}.top-doc .docblock h2{font-size:1.375rem;}.top-doc .docblock h3{font-size:1.25rem;}.top-doc .docblock h4,.top-doc .docblock h5{font-size:1.125rem;}.top-doc .docblock h6{font-size:1rem;}.docblock h5{font-size:1rem;}.docblock h6{font-size:0.875rem;}.docblock{margin-left:24px;position:relative;}.docblock>:not(.more-examples-toggle):not(.example-wrap){max-width:100%;overflow-x:auto;}.out-of-band{flex-grow:0;font-size:1.125rem;}.docblock code,.docblock-short code,pre,.rustdoc.src .example-wrap{background-color:var(--code-block-background-color);}#main-content{position:relative;}.docblock table{margin:.5em 0;border-collapse:collapse;}.docblock table td,.docblock table th{padding:.5em;border:1px solid var(--border-color);}.docblock table tbody tr:nth-child(2n){background:var(--table-alt-row-background-color);}div.where{white-space:pre-wrap;font-size:0.875rem;}.item-info{display:block;margin-left:24px;}.item-info code{font-size:0.875rem;}#main-content>.item-info{margin-left:0;}nav.sub{flex-grow:1;flex-flow:row nowrap;margin:4px 0 25px 0;display:flex;align-items:center;}.search-form{position:relative;display:flex;height:34px;flex-grow:1;}.src nav.sub{margin:0 0 15px 0;}.section-header{display:block;position:relative;}.section-header:hover>.anchor,.impl:hover>.anchor,.trait-impl:hover>.anchor,.variant:hover>.anchor{display:initial;}.anchor{display:none;position:absolute;left:-0.5em;background:none !important;}.anchor.field{left:-5px;}.section-header>.anchor{left:-15px;padding-right:8px;}h2.section-header>.anchor{padding-right:6px;}a.doc-anchor{color:var(--main-color);display:none;position:absolute;left:-17px;padding-right:5px;padding-left:3px;}*:hover>.doc-anchor{display:block;}.top-doc>.docblock>*:first-child>.doc-anchor{display:none !important;}.main-heading a:hover,.example-wrap .rust a:hover,.all-items a:hover,.docblock a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover:not(.doc-anchor),.docblock-short a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,.item-info a{text-decoration:underline;}.crate.block li.current a{font-weight:500;}table,.item-table{overflow-wrap:break-word;}.item-table{display:table;padding:0;margin:0;}.item-table>li{display:table-row;}.item-table>li>div{display:table-cell;}.item-table>li>.item-name{padding-right:1.25rem;}.search-results-title{margin-top:0;white-space:nowrap;display:flex;align-items:baseline;}#crate-search-div{position:relative;min-width:5em;}#crate-search{min-width:115px;padding:0 23px 0 4px;max-width:100%;text-overflow:ellipsis;border:1px solid var(--border-color);border-radius:4px;outline:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;background-color:var(--main-background-color);color:inherit;line-height:1.5;font-weight:500;}#crate-search:hover,#crate-search:focus{border-color:var(--crate-search-hover-border);}#crate-search-div::after{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0;content:"";background-repeat:no-repeat;background-size:20px;background-position:calc(100% - 2px) 56%;background-image:url('data:image/svg+xml, \ + ');filter:var(--crate-search-div-filter);}#crate-search-div:hover::after,#crate-search-div:focus-within::after{filter:var(--crate-search-div-hover-filter);}#crate-search>option{font-size:1rem;}.search-input{-webkit-appearance:none;outline:none;border:1px solid var(--border-color);border-radius:2px;padding:8px;font-size:1rem;flex-grow:1;background-color:var(--button-background-color);color:var(--search-color);}.search-input:focus{border-color:var(--search-input-focused-border-color);}.search-results{display:none;}.search-results.active{display:block;}.search-results>a{display:flex;margin-left:2px;margin-right:2px;border-bottom:1px solid var(--search-result-border-color);gap:1em;}.search-results>a>div.desc{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex:2;}.search-results a:hover,.search-results a:focus{background-color:var(--search-result-link-focus-background-color);}.search-results .result-name{display:flex;align-items:center;justify-content:start;flex:3;}.search-results .result-name .alias{color:var(--search-results-alias-color);}.search-results .result-name .grey{color:var(--search-results-grey-color);}.search-results .result-name .typename{color:var(--search-results-grey-color);font-size:0.875rem;width:var(--search-typename-width);}.search-results .result-name .path{word-break:break-all;max-width:calc(100% - var(--search-typename-width));display:inline-block;}.search-results .result-name .path>*{display:inline;}.popover{position:absolute;top:100%;right:0;z-index:calc(var(--desktop-sidebar-z-index) + 1);margin-top:7px;border-radius:3px;border:1px solid var(--border-color);background-color:var(--main-background-color);color:var(--main-color);--popover-arrow-offset:11px;}.popover::before{content:'';position:absolute;right:var(--popover-arrow-offset);border:solid var(--border-color);border-width:1px 1px 0 0;background-color:var(--main-background-color);padding:4px;transform:rotate(-45deg);top:-5px;}.setting-line{margin:1.2em 0.6em;}.setting-radio input,.setting-check input{margin-right:0.3em;height:1.2rem;width:1.2rem;border:2px solid var(--settings-input-border-color);outline:none;-webkit-appearance:none;cursor:pointer;}.setting-radio input{border-radius:50%;}.setting-radio span,.setting-check span{padding-bottom:1px;}.setting-radio{margin-top:0.1em;margin-bottom:0.1em;min-width:3.8em;padding:0.3em;display:inline-flex;align-items:center;cursor:pointer;}.setting-radio+.setting-radio{margin-left:0.5em;}.setting-check{margin-right:20px;display:flex;align-items:center;cursor:pointer;}.setting-radio input:checked{box-shadow:inset 0 0 0 3px var(--main-background-color);background-color:var(--settings-input-color);}.setting-check input:checked{background-color:var(--settings-input-color);border-width:1px;content:url('data:image/svg+xml,\ + \ + ');}.setting-radio input:focus,.setting-check input:focus{box-shadow:0 0 1px 1px var(--settings-input-color);}.setting-radio input:checked:focus{box-shadow:inset 0 0 0 3px var(--main-background-color),0 0 2px 2px var(--settings-input-color);}.setting-radio input:hover,.setting-check input:hover{border-color:var(--settings-input-color) !important;}#help.popover{max-width:600px;--popover-arrow-offset:48px;}#help dt{float:left;clear:left;margin-right:0.5rem;}#help span.top,#help span.bottom{text-align:center;display:block;font-size:1.125rem;}#help span.top{margin:10px 0;border-bottom:1px solid var(--border-color);padding-bottom:4px;margin-bottom:6px;}#help span.bottom{clear:both;border-top:1px solid var(--border-color);}.side-by-side>div{width:50%;float:left;padding:0 20px 20px 17px;}.item-info .stab{display:block;padding:3px;margin-bottom:5px;}.item-name .stab{margin-left:0.3125em;}.stab{padding:0 2px;font-size:0.875rem;font-weight:normal;color:var(--main-color);background-color:var(--stab-background-color);width:fit-content;white-space:pre-wrap;border-radius:3px;display:inline;vertical-align:baseline;}.stab.portability>code{background:none;color:var(--stab-code-color);}.stab .emoji,.item-info .stab::before{font-size:1.25rem;}.stab .emoji{margin-right:0.3rem;}.item-info .stab::before{content:"\0";width:0;display:inline-block;color:transparent;}.emoji{text-shadow:1px 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black;}.since{font-weight:normal;font-size:initial;}.rightside{padding-left:12px;float:right;}.rightside:not(a),.out-of-band{color:var(--right-side-color);}pre.rust{tab-size:4;-moz-tab-size:4;}pre.rust .kw{color:var(--code-highlight-kw-color);}pre.rust .kw-2{color:var(--code-highlight-kw-2-color);}pre.rust .lifetime{color:var(--code-highlight-lifetime-color);}pre.rust .prelude-ty{color:var(--code-highlight-prelude-color);}pre.rust .prelude-val{color:var(--code-highlight-prelude-val-color);}pre.rust .string{color:var(--code-highlight-string-color);}pre.rust .number{color:var(--code-highlight-number-color);}pre.rust .bool-val{color:var(--code-highlight-literal-color);}pre.rust .self{color:var(--code-highlight-self-color);}pre.rust .attr{color:var(--code-highlight-attribute-color);}pre.rust .macro,pre.rust .macro-nonterminal{color:var(--code-highlight-macro-color);}pre.rust .question-mark{font-weight:bold;color:var(--code-highlight-question-mark-color);}pre.rust .comment{color:var(--code-highlight-comment-color);}pre.rust .doccomment{color:var(--code-highlight-doc-comment-color);}.rustdoc.src .example-wrap pre.rust a{background:var(--codeblock-link-background);}.example-wrap.compile_fail,.example-wrap.should_panic{border-left:2px solid var(--codeblock-error-color);}.ignore.example-wrap{border-left:2px solid var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover,.example-wrap.should_panic:hover{border-left:2px solid var(--codeblock-error-hover-color);}.example-wrap.ignore:hover{border-left:2px solid var(--codeblock-ignore-hover-color);}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip{color:var(--codeblock-error-color);}.example-wrap.ignore .tooltip{color:var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover .tooltip,.example-wrap.should_panic:hover .tooltip{color:var(--codeblock-error-hover-color);}.example-wrap.ignore:hover .tooltip{color:var(--codeblock-ignore-hover-color);}.example-wrap .tooltip{position:absolute;display:block;left:-25px;top:5px;margin:0;line-height:1;}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip,.example-wrap.ignore .tooltip{font-weight:bold;font-size:1.25rem;}.content .docblock .warning{border-left:2px solid var(--warning-border-color);padding:14px;position:relative;overflow-x:visible !important;}.content .docblock .warning::before{color:var(--warning-border-color);content:"ⓘ";position:absolute;left:-25px;top:5px;font-weight:bold;font-size:1.25rem;}.top-doc>.docblock>.warning:first-child::before{top:20px;}a.test-arrow{visibility:hidden;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:1.375rem;top:5px;right:5px;z-index:1;color:var(--test-arrow-color);background-color:var(--test-arrow-background-color);}a.test-arrow:hover{color:var(--test-arrow-hover-color);background-color:var(--test-arrow-hover-background-color);}.example-wrap:hover .test-arrow{visibility:visible;}.code-attribute{font-weight:300;color:var(--code-attribute-color);}.item-spacer{width:100%;height:12px;display:block;}.out-of-band>span.since{font-size:1.25rem;}.sub-variant h4{font-size:1rem;font-weight:400;margin-top:0;margin-bottom:0;}.sub-variant{margin-left:24px;margin-bottom:40px;}.sub-variant>.sub-variant-field{margin-left:24px;}:target{padding-right:3px;background-color:var(--target-background-color);border-right:3px solid var(--target-border-color);}.code-header a.tooltip{color:inherit;margin-right:15px;position:relative;}.code-header a.tooltip:hover{color:var(--link-color);}a.tooltip:hover::after{position:absolute;top:calc(100% - 10px);left:-15px;right:-15px;height:20px;content:"\00a0";}.fade-out{opacity:0;transition:opacity 0.45s cubic-bezier(0,0,0.1,1.0);}.popover.tooltip .content{margin:0.25em 0.5em;}.popover.tooltip .content pre,.popover.tooltip .content code{background:transparent;margin:0;padding:0;font-size:1.25rem;white-space:pre-wrap;}.popover.tooltip .content>h3:first-child{margin:0 0 5px 0;}.search-failed{text-align:center;margin-top:20px;display:none;}.search-failed.active{display:block;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#search-tabs{display:flex;flex-direction:row;gap:1px;margin-bottom:4px;}#search-tabs button{text-align:center;font-size:1.125rem;border:0;border-top:2px solid;flex:1;line-height:1.5;color:inherit;}#search-tabs button:not(.selected){background-color:var(--search-tab-button-not-selected-background);border-top-color:var(--search-tab-button-not-selected-border-top-color);}#search-tabs button:hover,#search-tabs button.selected{background-color:var(--search-tab-button-selected-background);border-top-color:var(--search-tab-button-selected-border-top-color);}#search-tabs .count{font-size:1rem;font-variant-numeric:tabular-nums;color:var(--search-tab-title-count-color);}#search .error code{border-radius:3px;background-color:var(--search-error-code-background-color);}.search-corrections{font-weight:normal;}#src-sidebar{width:100%;overflow:auto;}#src-sidebar div.files>a:hover,details.dir-entry summary:hover,#src-sidebar div.files>a:focus,details.dir-entry summary:focus{background-color:var(--src-sidebar-background-hover);}#src-sidebar div.files>a.selected{background-color:var(--src-sidebar-background-selected);}.src-sidebar-title{position:sticky;top:0;display:flex;padding:8px 8px 0 48px;margin-bottom:7px;background:var(--sidebar-background-color);border-bottom:1px solid var(--border-color);}#settings-menu,#help-button{margin-left:4px;display:flex;}#sidebar-button{display:none;line-height:0;}.hide-sidebar #sidebar-button,.src #sidebar-button{display:flex;margin-right:4px;position:fixed;left:6px;height:34px;width:34px;background-color:var(--main-background-color);z-index:1;}.src #sidebar-button{left:8px;z-index:calc(var(--desktop-sidebar-z-index) + 1);}.hide-sidebar .src #sidebar-button{position:static;}#settings-menu>a,#help-button>a,#sidebar-button>a{display:flex;align-items:center;justify-content:center;background-color:var(--button-background-color);border:1px solid var(--border-color);border-radius:2px;color:var(--settings-button-color);font-size:20px;width:33px;}#settings-menu>a:hover,#settings-menu>a:focus,#help-button>a:hover,#help-button>a:focus,#sidebar-button>a:hover,#sidebar-button>a:focus{border-color:var(--settings-button-border-focus);}#settings-menu>a{line-height:0;font-size:0;}#settings-menu>a:before{content:url('wheel-63255fc4502dca9a.svg');width:22px;height:22px;}#sidebar-button>a:before{content:url('data:image/svg+xml,\ + \ + \ + ');width:22px;height:22px;}#copy-path{color:var(--copy-path-button-color);background:var(--main-background-color);height:34px;width:33px;margin-left:10px;padding:0;padding-left:2px;border:0;font-size:0;}#copy-path::before{filter:var(--copy-path-img-filter);content:url('clipboard-24048e6d87f63d07.svg');}#copy-path:hover::before{filter:var(--copy-path-img-hover-filter);}#copy-path.clicked::before{content:url('data:image/svg+xml,\ + \ + ');}@keyframes rotating{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}#settings-menu.rotate>a img{animation:rotating 2s linear infinite;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px var(--border-color);border-radius:3px;color:var(--kbd-color);background-color:var(--kbd-background);box-shadow:inset 0 -1px 0 var(--kbd-box-shadow-color);}ul.all-items>li{list-style:none;}details.dir-entry{padding-left:4px;}details.dir-entry>summary{margin:0 0 0 -4px;padding:0 0 0 4px;cursor:pointer;}details.dir-entry div.folders,details.dir-entry div.files{padding-left:23px;}details.dir-entry a{display:block;}details.toggle{contain:layout;position:relative;}details.toggle>summary.hideme{cursor:pointer;font-size:1rem;}details.toggle>summary{list-style:none;outline:none;}details.toggle>summary::-webkit-details-marker,details.toggle>summary::marker{display:none;}details.toggle>summary.hideme>span{margin-left:9px;}details.toggle>summary::before{background:url('data:image/svg+xml,') no-repeat top left;content:"";cursor:pointer;width:16px;height:16px;display:inline-block;vertical-align:middle;opacity:.5;filter:var(--toggle-filter);}details.toggle>summary.hideme>span,.more-examples-toggle summary,.more-examples-toggle .hide-more{color:var(--toggles-color);}details.toggle>summary::after{content:"Expand";overflow:hidden;width:0;height:0;position:absolute;}details.toggle>summary.hideme::after{content:"";}details.toggle>summary:focus::before,details.toggle>summary:hover::before{opacity:1;}details.toggle>summary:focus-visible::before{outline:1px dotted #000;outline-offset:1px;}details.non-exhaustive{margin-bottom:8px;}details.toggle>summary.hideme::before{position:relative;}details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;top:4px;}.impl-items>details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;}details.toggle[open] >summary.hideme{position:absolute;}details.toggle[open] >summary.hideme>span{display:none;}details.toggle[open] >summary::before{background:url('data:image/svg+xml,') no-repeat top left;}details.toggle[open] >summary::after{content:"Collapse";}.docblock summary>*{display:inline-block;}.docblock>.example-wrap:first-child .tooltip{margin-top:16px;}.src #sidebar-button>a:before,.sidebar-menu-toggle:before{content:url('data:image/svg+xml,\ + ');opacity:0.75;}.sidebar-menu-toggle:hover:before,.sidebar-menu-toggle:active:before,.sidebar-menu-toggle:focus:before{opacity:1;}.src #sidebar-button>a:before{content:url('data:image/svg+xml,\ + \ + \ + ');opacity:0.75;}@media (max-width:850px){#search-tabs .count{display:block;}}@media (max-width:700px){*[id]{scroll-margin-top:45px;}.rustdoc{display:block;}main{padding-left:15px;padding-top:0px;}.main-heading{flex-direction:column;}.out-of-band{text-align:left;margin-left:initial;padding:initial;}.out-of-band .since::before{content:"Since ";}.sidebar .logo-container,.sidebar .location,.sidebar-resizer{display:none;}.sidebar{position:fixed;top:45px;left:-1000px;z-index:11;height:calc(100vh - 45px);width:200px;}.src main,.rustdoc.src .sidebar{top:0;padding:0;height:100vh;border:0;}.src .search-form{margin-left:40px;}.hide-sidebar .search-form{margin-left:32px;}.hide-sidebar .src .search-form{margin-left:0;}.sidebar.shown,.src-sidebar-expanded .src .sidebar,.rustdoc:not(.src) .sidebar:focus-within{left:0;}.mobile-topbar h2{padding-bottom:0;margin:auto 0.5em auto auto;overflow:hidden;font-size:24px;white-space:nowrap;text-overflow:ellipsis;}.mobile-topbar .logo-container>img{max-width:35px;max-height:35px;margin:5px 0 5px 20px;}.mobile-topbar{display:flex;flex-direction:row;position:sticky;z-index:10;font-size:2rem;height:45px;width:100%;left:0;top:0;}.hide-sidebar .mobile-topbar{display:none;}.sidebar-menu-toggle{width:45px;border:none;line-height:0;}.hide-sidebar .sidebar-menu-toggle{display:none;}.sidebar-elems{margin-top:1em;}.anchor{display:none !important;}#main-content>details.toggle>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}#copy-path,#help-button{display:none;}#sidebar-button>a:before{content:url('data:image/svg+xml,\ + \ + \ + ');width:22px;height:22px;}.sidebar-menu-toggle:before{filter:var(--mobile-sidebar-menu-filter);}.sidebar-menu-toggle:hover{background:var(--main-background-color);}.item-table,.item-row,.item-table>li,.item-table>li>div,.search-results>a,.search-results>a>div{display:block;}.search-results>a{padding:5px 0px;}.search-results>a>div.desc,.item-table>li>div.desc{padding-left:2em;}.search-results .result-name{display:block;}.search-results .result-name .typename{width:initial;margin-right:0;}.search-results .result-name .typename,.search-results .result-name .path{display:inline;}.src-sidebar-expanded .src .sidebar{position:fixed;max-width:100vw;width:100vw;}.src .src-sidebar-title{padding-top:0;}details.toggle:not(.top-doc)>summary{margin-left:10px;}.impl-items>details.toggle>summary:not(.hideme)::before,#main-content>details.toggle:not(.top-doc)>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}.impl-items>.item-info{margin-left:34px;}.src nav.sub{margin:0;padding:var(--nav-sub-mobile-padding);}}@media (min-width:701px){.scraped-example-title{position:absolute;z-index:10;background:var(--main-background-color);bottom:8px;right:5px;padding:2px 4px;box-shadow:0 0 4px var(--main-background-color);}}@media print{nav.sidebar,nav.sub,.out-of-band,a.src,#copy-path,details.toggle[open] >summary::before,details.toggle>summary::before,details.toggle.top-doc>summary{display:none;}.docblock{margin-left:0;}main{padding:10px;}}@media (max-width:464px){.docblock{margin-left:12px;}.docblock code{overflow-wrap:break-word;overflow-wrap:anywhere;}nav.sub{flex-direction:column;}.search-form{align-self:stretch;}}.variant,.implementors-toggle>summary,.impl,#implementors-list>.docblock,.impl-items>section,.impl-items>.toggle>summary,.methods>section,.methods>.toggle>summary{margin-bottom:0.75em;}.variants>.docblock,.implementors-toggle>.docblock,.impl-items>.toggle[open]:not(:last-child),.methods>.toggle[open]:not(:last-child),.implementors-toggle[open]:not(:last-child){margin-bottom:2em;}#trait-implementations-list .impl-items>.toggle:not(:last-child),#synthetic-implementations-list .impl-items>.toggle:not(:last-child),#blanket-implementations-list .impl-items>.toggle:not(:last-child){margin-bottom:1em;}.scraped-example-list .scrape-help{margin-left:10px;padding:0 4px;font-weight:normal;font-size:12px;position:relative;bottom:1px;border:1px solid var(--scrape-example-help-border-color);border-radius:50px;color:var(--scrape-example-help-color);}.scraped-example-list .scrape-help:hover{border-color:var(--scrape-example-help-hover-border-color);color:var(--scrape-example-help-hover-color);}.scraped-example{position:relative;}.scraped-example .code-wrapper{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;}.scraped-example:not(.expanded) .code-wrapper{max-height:calc(1.5em * 5 + 10px);}.scraped-example:not(.expanded) .code-wrapper pre{overflow-y:hidden;padding-bottom:0;max-height:calc(1.5em * 5 + 10px);}.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper,.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper pre{max-height:calc(1.5em * 10 + 10px);}.scraped-example .code-wrapper .next,.scraped-example .code-wrapper .prev,.scraped-example .code-wrapper .expand{color:var(--main-color);position:absolute;top:0.25em;z-index:1;padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.scraped-example .code-wrapper .prev{right:2.25em;}.scraped-example .code-wrapper .next{right:1.25em;}.scraped-example .code-wrapper .expand{right:0.25em;}.scraped-example:not(.expanded) .code-wrapper::before,.scraped-example:not(.expanded) .code-wrapper::after{content:" ";width:100%;height:5px;position:absolute;z-index:1;}.scraped-example:not(.expanded) .code-wrapper::before{top:0;background:linear-gradient(to bottom,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example:not(.expanded) .code-wrapper::after{bottom:0;background:linear-gradient(to top,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example .code-wrapper .example-wrap{width:100%;overflow-y:hidden;margin-bottom:0;}.scraped-example:not(.expanded) .code-wrapper .example-wrap{overflow-x:hidden;}.scraped-example .example-wrap .rust span.highlight{background:var(--scrape-example-code-line-highlight);}.scraped-example .example-wrap .rust span.highlight.focus{background:var(--scrape-example-code-line-highlight-focus);}.more-examples-toggle{max-width:calc(100% + 25px);margin-top:10px;margin-left:-25px;}.more-examples-toggle .hide-more{margin-left:25px;cursor:pointer;}.more-scraped-examples{margin-left:25px;position:relative;}.toggle-line{position:absolute;top:5px;bottom:0;right:calc(100% + 10px);padding:0 4px;cursor:pointer;}.toggle-line-inner{min-width:2px;height:100%;background:var(--scrape-example-toggle-line-background);}.toggle-line:hover .toggle-line-inner{background:var(--scrape-example-toggle-line-hover-background);}.more-scraped-examples .scraped-example,.example-links{margin-top:20px;}.more-scraped-examples .scraped-example:first-child{margin-top:5px;}.example-links ul{margin-bottom:0;}:root[data-theme="light"],:root:not([data-theme]){--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--sidebar-background-color:#f5f5f5;--sidebar-background-color-hover:#e0e0e0;--code-block-background-color:#f5f5f5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--mobile-sidebar-menu-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);--sidebar-resizer-hover:hsl(207,90%,66%);--sidebar-resizer-active:hsl(207,90%,54%);}:root[data-theme="dark"]{--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--mobile-sidebar-menu-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);--sidebar-resizer-hover:hsl(207,30%,54%);--sidebar-resizer-active:hsl(207,90%,54%);}:root[data-theme="ayu"]{--main-background-color:#0f1419;--main-color:#c5c5c5;--settings-input-color:#ffb454;--settings-input-border-color:#999;--settings-button-color:#fff;--settings-button-border-focus:#e0e0e0;--sidebar-background-color:#14191f;--sidebar-background-color-hover:rgba(70,70,70,0.33);--code-block-background-color:#191f26;--scrollbar-track-background-color:transparent;--scrollbar-thumb-background-color:#5c6773;--scrollbar-color:#5c6773 #24292f;--headings-border-bottom-color:#5c6773;--border-color:#5c6773;--button-background-color:#141920;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--mobile-sidebar-menu-filter:invert(100%);--search-input-focused-border-color:#5c6773;--copy-path-button-color:#fff;--copy-path-img-filter:invert(70%);--copy-path-img-hover-filter:invert(100%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ffa0a5;--trait-link-color:#39afd7;--assoc-item-link-color:#39afd7;--function-link-color:#fdd687;--macro-link-color:#a37acc;--keyword-link-color:#39afd7;--mod-link-color:#39afd7;--link-color:#39afd7;--sidebar-link-color:#53b1db;--sidebar-current-link-background-color:transparent;--search-result-link-focus-background-color:#3c3c3c;--search-result-border-color:#aaa3;--search-color:#fff;--search-error-code-background-color:#4f4c4c;--search-results-alias-color:#c5c5c5;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:none;--search-tab-button-not-selected-background:transparent !important;--search-tab-button-selected-border-top-color:none;--search-tab-button-selected-background:#141920 !important;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ff7733;--code-highlight-kw-2-color:#ff7733;--code-highlight-lifetime-color:#ff7733;--code-highlight-prelude-color:#69f2df;--code-highlight-prelude-val-color:#ff7733;--code-highlight-number-color:#b8cc52;--code-highlight-string-color:#b8cc52;--code-highlight-literal-color:#ff7733;--code-highlight-attribute-color:#e6e1cf;--code-highlight-self-color:#36a3d9;--code-highlight-macro-color:#a37acc;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#788797;--code-highlight-doc-comment-color:#a1ac88;--src-line-numbers-span-color:#5c6773;--src-line-number-highlighted-background-color:rgba(255,236,164,0.06);--test-arrow-color:#788797;--test-arrow-background-color:rgba(57,175,215,0.09);--test-arrow-hover-color:#c5c5c5;--test-arrow-hover-background-color:rgba(57,175,215,0.368);--target-background-color:rgba(255,236,164,0.06);--target-border-color:rgba(255,180,76,0.85);--kbd-color:#c5c5c5;--kbd-background:#314559;--kbd-box-shadow-color:#5c6773;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(41%) sepia(12%) saturate(487%) hue-rotate(171deg) brightness(94%) contrast(94%);--crate-search-div-hover-filter:invert(98%) sepia(12%) saturate(81%) hue-rotate(343deg) brightness(113%) contrast(76%);--crate-search-hover-border:#e0e0e0;--src-sidebar-background-selected:#14191f;--src-sidebar-background-hover:#14191f;--table-alt-row-background-color:#191f26;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(15,20,25,1);--scrape-example-code-wrapper-background-end:rgba(15,20,25,0);--sidebar-resizer-hover:hsl(34,50%,33%);--sidebar-resizer-active:hsl(34,100%,66%);}:root[data-theme="ayu"] h1,:root[data-theme="ayu"] h2,:root[data-theme="ayu"] h3,:root[data-theme="ayu"] h4,:where(:root[data-theme="ayu"]) h1 a,:root[data-theme="ayu"] .sidebar h2 a,:root[data-theme="ayu"] .sidebar h3 a{color:#fff;}:root[data-theme="ayu"] .docblock code{color:#ffb454;}:root[data-theme="ayu"] .docblock a>code{color:#39AFD7 !important;}:root[data-theme="ayu"] .code-header,:root[data-theme="ayu"] .docblock pre>code,:root[data-theme="ayu"] pre,:root[data-theme="ayu"] pre>code,:root[data-theme="ayu"] .item-info code,:root[data-theme="ayu"] .rustdoc.source .example-wrap{color:#e6e1cf;}:root[data-theme="ayu"] .sidebar .current,:root[data-theme="ayu"] .sidebar .current a,:root[data-theme="ayu"] .sidebar a:hover,:root[data-theme="ayu"] #src-sidebar div.files>a:hover,:root[data-theme="ayu"] details.dir-entry summary:hover,:root[data-theme="ayu"] #src-sidebar div.files>a:focus,:root[data-theme="ayu"] details.dir-entry summary:focus,:root[data-theme="ayu"] #src-sidebar div.files>a.selected{color:#ffb44c;}:root[data-theme="ayu"] .sidebar-elems .location{color:#ff7733;}:root[data-theme="ayu"] .src-line-numbers .line-highlighted{color:#708090;padding-right:7px;border-right:1px solid #ffb44c;}:root[data-theme="ayu"] .search-results a:hover,:root[data-theme="ayu"] .search-results a:focus{color:#fff !important;background-color:#3c3c3c;}:root[data-theme="ayu"] .search-results a{color:#0096cf;}:root[data-theme="ayu"] .search-results a div.desc{color:#c5c5c5;}:root[data-theme="ayu"] .result-name .primitive>i,:root[data-theme="ayu"] .result-name .keyword>i{color:#788797;}:root[data-theme="ayu"] #search-tabs>button.selected{border-bottom:1px solid #ffb44c !important;border-top:none;}:root[data-theme="ayu"] #search-tabs>button:not(.selected){border:none;background-color:transparent !important;}:root[data-theme="ayu"] #search-tabs>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}:root[data-theme="ayu"] #settings-menu>a img,:root[data-theme="ayu"] #sidebar-button>a:before{filter:invert(100);} \ No newline at end of file diff --git a/docs/static.files/scrape-examples-ef1e698c1d417c0c.js b/docs/static.files/scrape-examples-ef1e698c1d417c0c.js new file mode 100644 index 00000000..ba830e37 --- /dev/null +++ b/docs/static.files/scrape-examples-ef1e698c1d417c0c.js @@ -0,0 +1 @@ +"use strict";(function(){const DEFAULT_MAX_LINES=5;const HIDDEN_MAX_LINES=10;function scrollToLoc(elt,loc,isHidden){const lines=elt.querySelector(".src-line-numbers");let scrollOffset;const maxLines=isHidden?HIDDEN_MAX_LINES:DEFAULT_MAX_LINES;if(loc[1]-loc[0]>maxLines){const line=Math.max(0,loc[0]-1);scrollOffset=lines.children[line].offsetTop}else{const wrapper=elt.querySelector(".code-wrapper");const halfHeight=wrapper.offsetHeight/2;const offsetTop=lines.children[loc[0]].offsetTop;const lastLine=lines.children[loc[1]];const offsetBot=lastLine.offsetTop+lastLine.offsetHeight;const offsetMid=(offsetTop+offsetBot)/2;scrollOffset=offsetMid-halfHeight}lines.scrollTo(0,scrollOffset);elt.querySelector(".rust").scrollTo(0,scrollOffset)}function updateScrapedExample(example,isHidden){const locs=JSON.parse(example.attributes.getNamedItem("data-locs").textContent);let locIndex=0;const highlights=Array.prototype.slice.call(example.querySelectorAll(".highlight"));const link=example.querySelector(".scraped-example-title a");if(locs.length>1){const onChangeLoc=changeIndex=>{removeClass(highlights[locIndex],"focus");changeIndex();scrollToLoc(example,locs[locIndex][0],isHidden);addClass(highlights[locIndex],"focus");const url=locs[locIndex][1];const title=locs[locIndex][2];link.href=url;link.innerHTML=title};example.querySelector(".prev").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex-1+locs.length)%locs.length})});example.querySelector(".next").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex+1)%locs.length})})}const expandButton=example.querySelector(".expand");if(expandButton){expandButton.addEventListener("click",()=>{if(hasClass(example,"expanded")){removeClass(example,"expanded");scrollToLoc(example,locs[0][0],isHidden)}else{addClass(example,"expanded")}})}scrollToLoc(example,locs[0][0],isHidden)}const firstExamples=document.querySelectorAll(".scraped-example-list > .scraped-example");onEachLazy(firstExamples,el=>updateScrapedExample(el,false));onEachLazy(document.querySelectorAll(".more-examples-toggle"),toggle=>{onEachLazy(toggle.querySelectorAll(".toggle-line, .hide-more"),button=>{button.addEventListener("click",()=>{toggle.open=false})});const moreExamples=toggle.querySelectorAll(".scraped-example");toggle.querySelector("summary").addEventListener("click",()=>{setTimeout(()=>{onEachLazy(moreExamples,el=>updateScrapedExample(el,true))})},{once:true})})})() \ No newline at end of file diff --git a/docs/static.files/search-bf21c90c8c1d92b1.js b/docs/static.files/search-bf21c90c8c1d92b1.js new file mode 100644 index 00000000..81d04e0e --- /dev/null +++ b/docs/static.files/search-bf21c90c8c1d92b1.js @@ -0,0 +1,5 @@ +"use strict";if(!Array.prototype.toSpliced){Array.prototype.toSpliced=function(){const me=this.slice();Array.prototype.splice.apply(me,arguments);return me}}(function(){const itemTypes=["keyword","primitive","mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","associatedtype","constant","associatedconstant","union","foreigntype","existential","attr","derive","traitalias","generic",];const longItemTypes=["keyword","primitive type","module","extern crate","re-export","struct","enum","function","type alias","static","trait","","trait method","method","struct field","enum variant","macro","assoc type","constant","assoc const","union","foreign type","existential type","attribute macro","derive macro","trait alias",];const TY_GENERIC=itemTypes.indexOf("generic");const TY_IMPORT=itemTypes.indexOf("import");const ROOT_PATH=typeof window!=="undefined"?window.rootPath:"../";const UNBOXING_LIMIT=5;function printTab(nb){let iter=0;let foundCurrentTab=false;let foundCurrentResultSet=false;onEachLazy(document.getElementById("search-tabs").childNodes,elem=>{if(nb===iter){addClass(elem,"selected");foundCurrentTab=true}else{removeClass(elem,"selected")}iter+=1});const isTypeSearch=(nb>0||iter===1);iter=0;onEachLazy(document.getElementById("results").childNodes,elem=>{if(nb===iter){addClass(elem,"active");foundCurrentResultSet=true}else{removeClass(elem,"active")}iter+=1});if(foundCurrentTab&&foundCurrentResultSet){searchState.currentTab=nb;const correctionsElem=document.getElementsByClassName("search-corrections");if(isTypeSearch){removeClass(correctionsElem[0],"hidden")}else{addClass(correctionsElem[0],"hidden")}}else if(nb!==0){printTab(0)}}const editDistanceState={current:[],prev:[],prevPrev:[],calculate:function calculate(a,b,limit){if(a.lengthlimit){return limit+1}while(b.length>0&&b[0]===a[0]){a=a.substring(1);b=b.substring(1)}while(b.length>0&&b[b.length-1]===a[a.length-1]){a=a.substring(0,a.length-1);b=b.substring(0,b.length-1)}if(b.length===0){return minDist}const aLength=a.length;const bLength=b.length;for(let i=0;i<=bLength;++i){this.current[i]=0;this.prev[i]=i;this.prevPrev[i]=Number.MAX_VALUE}for(let i=1;i<=aLength;++i){this.current[0]=i;const aIdx=i-1;for(let j=1;j<=bLength;++j){const bIdx=j-1;const substitutionCost=a[aIdx]===b[bIdx]?0:1;this.current[j]=Math.min(this.prev[j]+1,this.current[j-1]+1,this.prev[j-1]+substitutionCost,);if((i>1)&&(j>1)&&(a[aIdx]===b[bIdx-1])&&(a[aIdx-1]===b[bIdx])){this.current[j]=Math.min(this.current[j],this.prevPrev[j-2]+1,)}}const prevPrevTmp=this.prevPrev;this.prevPrev=this.prev;this.prev=this.current;this.current=prevPrevTmp}const distance=this.prev[bLength];return distance<=limit?distance:(limit+1)},};function editDistance(a,b,limit){return editDistanceState.calculate(a,b,limit)}function initSearch(rawSearchIndex){const MAX_RESULTS=200;const NO_TYPE_FILTER=-1;let searchIndex;let searchIndexDeprecated;let searchIndexEmptyDesc;let functionTypeFingerprint;let currentResults;const typeNameIdMap=new Map();const ALIASES=new Map();const typeNameIdOfArray=buildTypeMapIndex("array");const typeNameIdOfSlice=buildTypeMapIndex("slice");const typeNameIdOfArrayOrSlice=buildTypeMapIndex("[]");const typeNameIdOfTuple=buildTypeMapIndex("tuple");const typeNameIdOfUnit=buildTypeMapIndex("unit");const typeNameIdOfTupleOrUnit=buildTypeMapIndex("()");const typeNameIdOfFn=buildTypeMapIndex("fn");const typeNameIdOfFnMut=buildTypeMapIndex("fnmut");const typeNameIdOfFnOnce=buildTypeMapIndex("fnonce");const typeNameIdOfHof=buildTypeMapIndex("->");function buildTypeMapIndex(name,isAssocType){if(name===""||name===null){return null}if(typeNameIdMap.has(name)){const obj=typeNameIdMap.get(name);obj.assocOnly=isAssocType&&obj.assocOnly;return obj.id}else{const id=typeNameIdMap.size;typeNameIdMap.set(name,{id,assocOnly:isAssocType});return id}}function isSpecialStartCharacter(c){return"<\"".indexOf(c)!==-1}function isEndCharacter(c){return"=,>-])".indexOf(c)!==-1}function itemTypeFromName(typename){const index=itemTypes.findIndex(i=>i===typename);if(index<0){throw["Unknown type filter ",typename]}return index}function getStringElem(query,parserState,isInGenerics){if(isInGenerics){throw["Unexpected ","\""," in generics"]}else if(query.literalSearch){throw["Cannot have more than one literal search element"]}else if(parserState.totalElems-parserState.genericsElems>0){throw["Cannot use literal search when there is more than one element"]}parserState.pos+=1;const start=parserState.pos;const end=getIdentEndPosition(parserState);if(parserState.pos>=parserState.length){throw["Unclosed ","\""]}else if(parserState.userQuery[end]!=="\""){throw["Unexpected ",parserState.userQuery[end]," in a string element"]}else if(start===end){throw["Cannot have empty string element"]}parserState.pos+=1;query.literalSearch=true}function isPathStart(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="::"}function isReturnArrow(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="->"}function isIdentCharacter(c){return(c==="_"||(c>="0"&&c<="9")||(c>="a"&&c<="z")||(c>="A"&&c<="Z"))}function isSeparatorCharacter(c){return c===","||c==="="}function isPathSeparator(c){return c===":"||c===" "}function prevIs(parserState,lookingFor){let pos=parserState.pos;while(pos>0){const c=parserState.userQuery[pos-1];if(c===lookingFor){return true}else if(c!==" "){break}pos-=1}return false}function isLastElemGeneric(elems,parserState){return(elems.length>0&&elems[elems.length-1].generics.length>0)||prevIs(parserState,">")}function skipWhitespace(parserState){while(parserState.pos0){throw["Cannot have more than one element if you use quotes"]}const typeFilter=parserState.typeFilter;parserState.typeFilter=null;if(name==="!"){if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive never type ","!"," and ",typeFilter," both specified",]}if(generics.length!==0){throw["Never type ","!"," does not accept generic parameters",]}const bindingName=parserState.isInBinding;parserState.isInBinding=null;return makePrimitiveElement("never",{bindingName})}const quadcolon=/::\s*::/.exec(path);if(path.startsWith("::")){throw["Paths cannot start with ","::"]}else if(path.endsWith("::")){throw["Paths cannot end with ","::"]}else if(quadcolon!==null){throw["Unexpected ",quadcolon[0]]}const pathSegments=path.split(/(?:::\s*)|(?:\s+(?:::\s*)?)/);if(pathSegments.length===0||(pathSegments.length===1&&pathSegments[0]==="")){if(generics.length>0||prevIs(parserState,">")){throw["Found generics without a path"]}else{throw["Unexpected ",parserState.userQuery[parserState.pos]]}}for(const[i,pathSegment]of pathSegments.entries()){if(pathSegment==="!"){if(i!==0){throw["Never type ","!"," is not associated item"]}pathSegments[i]="never"}}parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}const bindingName=parserState.isInBinding;parserState.isInBinding=null;const bindings=new Map();const pathLast=pathSegments[pathSegments.length-1];return{name:name.trim(),id:null,fullPath:pathSegments,pathWithoutLast:pathSegments.slice(0,pathSegments.length-1),pathLast,normalizedPathLast:pathLast.replace(/_/g,""),generics:generics.filter(gen=>{if(gen.bindingName!==null){if(gen.name!==null){gen.bindingName.generics.unshift(gen)}bindings.set(gen.bindingName.name,gen.bindingName.generics);return false}return true}),bindings,typeFilter,bindingName,}}function getIdentEndPosition(parserState){const start=parserState.pos;let end=parserState.pos;let foundExclamation=-1;while(parserState.pos0){throw["Unexpected ",c," after ",parserState.userQuery[parserState.pos-1]]}else{throw["Unexpected ",c]}}parserState.pos+=1;end=parserState.pos}if(foundExclamation!==-1&&foundExclamation!==start&&isIdentCharacter(parserState.userQuery[foundExclamation-1])){if(parserState.typeFilter===null){parserState.typeFilter="macro"}else if(parserState.typeFilter!=="macro"){throw["Invalid search type: macro ","!"," and ",parserState.typeFilter," both specified",]}end=foundExclamation}return end}function getFilteredNextElem(query,parserState,elems,isInGenerics){const start=parserState.pos;if(parserState.userQuery[parserState.pos]===":"&&!isPathStart(parserState)){throw["Expected type filter before ",":"]}getNextElem(query,parserState,elems,isInGenerics);if(parserState.userQuery[parserState.pos]===":"&&!isPathStart(parserState)){if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}if(elems.length===0){throw["Expected type filter before ",":"]}else if(query.literalSearch){throw["Cannot use quotes on type filter"]}const typeFilterElem=elems.pop();checkExtraTypeFilterCharacters(start,parserState);parserState.typeFilter=typeFilterElem.name;parserState.pos+=1;parserState.totalElems-=1;query.literalSearch=false;getNextElem(query,parserState,elems,isInGenerics)}}function getNextElem(query,parserState,elems,isInGenerics){const generics=[];skipWhitespace(parserState);let start=parserState.pos;let end;if("[(".indexOf(parserState.userQuery[parserState.pos])!==-1){let endChar=")";let name="()";let friendlyName="tuple";if(parserState.userQuery[parserState.pos]==="["){endChar="]";name="[]";friendlyName="slice"}parserState.pos+=1;const{foundSeparator}=getItemsBefore(query,parserState,generics,endChar);const typeFilter=parserState.typeFilter;const bindingName=parserState.isInBinding;parserState.typeFilter=null;parserState.isInBinding=null;for(const gen of generics){if(gen.bindingName!==null){throw["Type parameter ","=",` cannot be within ${friendlyName} `,name]}}if(name==="()"&&!foundSeparator&&generics.length===1&&typeFilter===null){elems.push(generics[0])}else if(name==="()"&&generics.length===1&&generics[0].name==="->"){generics[0].typeFilter=typeFilter;elems.push(generics[0])}else{if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive ",name," and ",typeFilter," both specified",]}parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}elems.push(makePrimitiveElement(name,{bindingName,generics}))}}else{const isStringElem=parserState.userQuery[start]==="\"";if(isStringElem){start+=1;getStringElem(query,parserState,isInGenerics);end=parserState.pos-1}else{end=getIdentEndPosition(parserState)}if(parserState.pos=end){throw["Found generics without a path"]}parserState.pos+=1;getItemsBefore(query,parserState,generics,">")}else if(parserState.pos=end){throw["Found generics without a path"]}if(parserState.isInBinding){throw["Unexpected ","("," after ","="]}parserState.pos+=1;const typeFilter=parserState.typeFilter;parserState.typeFilter=null;getItemsBefore(query,parserState,generics,")");skipWhitespace(parserState);if(isReturnArrow(parserState)){parserState.pos+=2;skipWhitespace(parserState);getFilteredNextElem(query,parserState,generics,isInGenerics);generics[generics.length-1].bindingName=makePrimitiveElement("output")}else{generics.push(makePrimitiveElement(null,{bindingName:makePrimitiveElement("output"),typeFilter:null,}))}parserState.typeFilter=typeFilter}if(isStringElem){skipWhitespace(parserState)}if(start>=end&&generics.length===0){return}if(parserState.userQuery[parserState.pos]==="="){if(parserState.isInBinding){throw["Cannot write ","="," twice in a binding"]}if(!isInGenerics){throw["Type parameter ","="," must be within generics list"]}const name=parserState.userQuery.slice(start,end).trim();if(name==="!"){throw["Type parameter ","="," key cannot be ","!"," never type"]}if(name.includes("!")){throw["Type parameter ","="," key cannot be ","!"," macro"]}if(name.includes("::")){throw["Type parameter ","="," key cannot contain ","::"," path"]}if(name.includes(":")){throw["Type parameter ","="," key cannot contain ",":"," type"]}parserState.isInBinding={name,generics}}else{elems.push(createQueryElement(query,parserState,parserState.userQuery.slice(start,end),generics,isInGenerics,),)}}}function getItemsBefore(query,parserState,elems,endChar){let foundStopChar=true;let foundSeparator=false;const oldTypeFilter=parserState.typeFilter;parserState.typeFilter=null;const oldIsInBinding=parserState.isInBinding;parserState.isInBinding=null;let hofParameters=null;let extra="";if(endChar===">"){extra="<"}else if(endChar==="]"){extra="["}else if(endChar===")"){extra="("}else if(endChar===""){extra="->"}else{extra=endChar}while(parserState.pos"," after ","="]}hofParameters=[...elems];elems.length=0;parserState.pos+=2;foundStopChar=true;foundSeparator=false;continue}else if(c===" "){parserState.pos+=1;continue}else if(isSeparatorCharacter(c)){parserState.pos+=1;foundStopChar=true;foundSeparator=true;continue}else if(c===":"&&isPathStart(parserState)){throw["Unexpected ","::",": paths cannot start with ","::"]}else if(isEndCharacter(c)){throw["Unexpected ",c," after ",extra]}if(!foundStopChar){let extra=[];if(isLastElemGeneric(query.elems,parserState)){extra=[" after ",">"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(endChar!==""){throw["Expected ",",",", ","=",", or ",endChar,...extra,", found ",c,]}throw["Expected ",","," or ","=",...extra,", found ",c,]}const posBefore=parserState.pos;getFilteredNextElem(query,parserState,elems,endChar!=="");if(endChar!==""&&parserState.pos>=parserState.length){throw["Unclosed ",extra]}if(posBefore===parserState.pos){parserState.pos+=1}foundStopChar=false}if(parserState.pos>=parserState.length&&endChar!==""){throw["Unclosed ",extra]}parserState.pos+=1;if(hofParameters){foundSeparator=false;if([...elems,...hofParameters].some(x=>x.bindingName)||parserState.isInBinding){throw["Unexpected ","="," within ","->"]}const hofElem=makePrimitiveElement("->",{generics:hofParameters,bindings:new Map([["output",[...elems]]]),typeFilter:null,});elems.length=0;elems[0]=hofElem}parserState.typeFilter=oldTypeFilter;parserState.isInBinding=oldIsInBinding;return{foundSeparator}}function checkExtraTypeFilterCharacters(start,parserState){const query=parserState.userQuery.slice(start,parserState.pos).trim();for(const c in query){if(!isIdentCharacter(query[c])){throw["Unexpected ",query[c]," in type filter (before ",":",")",]}}}function parseInput(query,parserState){let foundStopChar=true;while(parserState.pos"){if(isReturnArrow(parserState)){break}throw["Unexpected ",c," (did you mean ","->","?)"]}else if(parserState.pos>0){throw["Unexpected ",c," after ",parserState.userQuery[parserState.pos-1]]}throw["Unexpected ",c]}else if(c===" "){skipWhitespace(parserState);continue}if(!foundStopChar){let extra="";if(isLastElemGeneric(query.elems,parserState)){extra=[" after ",">"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(parserState.typeFilter!==null){throw["Expected ",","," or ","->",...extra,", found ",c,]}throw["Expected ",",",", ",":"," or ","->",...extra,", found ",c,]}const before=query.elems.length;getFilteredNextElem(query,parserState,query.elems,false);if(query.elems.length===before){parserState.pos+=1}foundStopChar=false}if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}while(parserState.pos"]}break}else{parserState.pos+=1}}}function newParsedQuery(userQuery){return{original:userQuery,userQuery:userQuery.toLowerCase(),elems:[],returned:[],foundElems:0,totalElems:0,literalSearch:false,error:null,correction:null,proposeCorrectionFrom:null,proposeCorrectionTo:null,typeFingerprint:new Uint32Array(4),}}function buildUrl(search,filterCrates){let extra="?search="+encodeURIComponent(search);if(filterCrates!==null){extra+="&filter-crate="+encodeURIComponent(filterCrates)}return getNakedUrl()+extra+window.location.hash}function getFilterCrates(){const elem=document.getElementById("crate-search");if(elem&&elem.value!=="all crates"&&rawSearchIndex.has(elem.value)){return elem.value}return null}function parseQuery(userQuery){function convertTypeFilterOnElem(elem){if(elem.typeFilter!==null){let typeFilter=elem.typeFilter;if(typeFilter==="const"){typeFilter="constant"}elem.typeFilter=itemTypeFromName(typeFilter)}else{elem.typeFilter=NO_TYPE_FILTER}for(const elem2 of elem.generics){convertTypeFilterOnElem(elem2)}for(const constraints of elem.bindings.values()){for(const constraint of constraints){convertTypeFilterOnElem(constraint)}}}userQuery=userQuery.trim().replace(/\r|\n|\t/g," ");const parserState={length:userQuery.length,pos:0,totalElems:0,genericsElems:0,typeFilter:null,isInBinding:null,userQuery:userQuery.toLowerCase(),};let query=newParsedQuery(userQuery);try{parseInput(query,parserState);for(const elem of query.elems){convertTypeFilterOnElem(elem)}for(const elem of query.returned){convertTypeFilterOnElem(elem)}}catch(err){query=newParsedQuery(userQuery);query.error=err;return query}if(!query.literalSearch){query.literalSearch=parserState.totalElems>1}query.foundElems=query.elems.length+query.returned.length;query.totalElems=parserState.totalElems;return query}function createQueryResults(results_in_args,results_returned,results_others,parsedQuery){return{"in_args":results_in_args,"returned":results_returned,"others":results_others,"query":parsedQuery,}}async function execQuery(parsedQuery,filterCrates,currentCrate){const results_others=new Map(),results_in_args=new Map(),results_returned=new Map();function transformResults(results){const duplicates=new Set();const out=[];for(const result of results){if(result.id!==-1){const obj=searchIndex[result.id];obj.dist=result.dist;const res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=res[2]+"|"+obj.ty;if(duplicates.has(obj.fullPath)){continue}if(obj.ty===TY_IMPORT&&duplicates.has(res[2])){continue}if(duplicates.has(res[2]+"|"+TY_IMPORT)){continue}duplicates.add(obj.fullPath);duplicates.add(res[2]);obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out}async function sortResults(results,isType,preferredCrate){const userQuery=parsedQuery.userQuery;const result_list=[];for(const result of results.values()){result.item=searchIndex[result.id];result.word=searchIndex[result.id].word;result_list.push(result)}result_list.sort((aaa,bbb)=>{let a,b;a=(aaa.word!==userQuery);b=(bbb.word!==userQuery);if(a!==b){return a-b}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.path_dist;b=bbb.path_dist;if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}a=(aaa.dist);b=(bbb.dist);if(a!==b){return a-b}a=searchIndexDeprecated.get(aaa.item.crate).contains(aaa.item.bitIndex);b=searchIndexDeprecated.get(bbb.item.crate).contains(bbb.item.bitIndex);if(a!==b){return a-b}a=(aaa.item.crate!==preferredCrate);b=(bbb.item.crate!==preferredCrate);if(a!==b){return a-b}a=aaa.word.length;b=bbb.word.length;if(a!==b){return a-b}a=aaa.word;b=bbb.word;if(a!==b){return(a>b?+1:-1)}a=searchIndexEmptyDesc.get(aaa.item.crate).contains(aaa.item.bitIndex);b=searchIndexEmptyDesc.get(bbb.item.crate).contains(bbb.item.bitIndex);if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});return transformResults(result_list)}function unifyFunctionTypes(fnTypesIn,queryElems,whereClause,mgensIn,solutionCb,unboxingDepth,){if(unboxingDepth>=UNBOXING_LIMIT){return false}const mgens=mgensIn===null?null:new Map(mgensIn);if(queryElems.length===0){return!solutionCb||solutionCb(mgens)}if(!fnTypesIn||fnTypesIn.length===0){return false}const ql=queryElems.length;const fl=fnTypesIn.length;if(ql===1&&queryElems[0].generics.length===0&&queryElems[0].bindings.size===0){const queryElem=queryElems[0];for(const fnType of fnTypesIn){if(!unifyFunctionTypeIsMatchCandidate(fnType,queryElem,mgens)){continue}if(fnType.id<0&&queryElem.id<0){if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==queryElem.id){continue}const mgensScratch=new Map(mgens);mgensScratch.set(fnType.id,queryElem.id);if(!solutionCb||solutionCb(mgensScratch)){return true}}else if(!solutionCb||solutionCb(mgens?new Map(mgens):null)){return true}}for(const fnType of fnTypesIn){if(!unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth+1,)){continue}if(fnType.id<0){if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==0){continue}const mgensScratch=new Map(mgens);mgensScratch.set(fnType.id,0);if(unifyFunctionTypes(whereClause[(-fnType.id)-1],queryElems,whereClause,mgensScratch,solutionCb,unboxingDepth+1,)){return true}}else if(unifyFunctionTypes([...fnType.generics,...Array.from(fnType.bindings.values()).flat()],queryElems,whereClause,mgens?new Map(mgens):null,solutionCb,unboxingDepth+1,)){return true}}return false}const fnTypes=fnTypesIn.slice();const flast=fl-1;const qlast=ql-1;const queryElem=queryElems[qlast];let queryElemsTmp=null;for(let i=flast;i>=0;i-=1){const fnType=fnTypes[i];if(!unifyFunctionTypeIsMatchCandidate(fnType,queryElem,mgens)){continue}let mgensScratch;if(fnType.id<0){mgensScratch=new Map(mgens);if(mgensScratch.has(fnType.id)&&mgensScratch.get(fnType.id)!==queryElem.id){continue}mgensScratch.set(fnType.id,queryElem.id)}else{mgensScratch=mgens}fnTypes[i]=fnTypes[flast];fnTypes.length=flast;if(!queryElemsTmp){queryElemsTmp=queryElems.slice(0,qlast)}const passesUnification=unifyFunctionTypes(fnTypes,queryElemsTmp,whereClause,mgensScratch,mgensScratch=>{if(fnType.generics.length===0&&queryElem.generics.length===0&&fnType.bindings.size===0&&queryElem.bindings.size===0){return!solutionCb||solutionCb(mgensScratch)}const solution=unifyFunctionTypeCheckBindings(fnType,queryElem,whereClause,mgensScratch,unboxingDepth,);if(!solution){return false}const simplifiedGenerics=solution.simplifiedGenerics;for(const simplifiedMgens of solution.mgens){const passesUnification=unifyFunctionTypes(simplifiedGenerics,queryElem.generics,whereClause,simplifiedMgens,solutionCb,unboxingDepth,);if(passesUnification){return true}}return false},unboxingDepth,);if(passesUnification){return true}fnTypes[flast]=fnTypes[i];fnTypes[i]=fnType;fnTypes.length=fl}for(let i=flast;i>=0;i-=1){const fnType=fnTypes[i];if(!unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth+1,)){continue}let mgensScratch;if(fnType.id<0){mgensScratch=new Map(mgens);if(mgensScratch.has(fnType.id)&&mgensScratch.get(fnType.id)!==0){continue}mgensScratch.set(fnType.id,0)}else{mgensScratch=mgens}const generics=fnType.id<0?whereClause[(-fnType.id)-1]:fnType.generics;const bindings=fnType.bindings?Array.from(fnType.bindings.values()).flat():[];const passesUnification=unifyFunctionTypes(fnTypes.toSpliced(i,1,...generics,...bindings),queryElems,whereClause,mgensScratch,solutionCb,unboxingDepth+1,);if(passesUnification){return true}}return false}function unifyFunctionTypeIsMatchCandidate(fnType,queryElem,mgensIn){if(!typePassesFilter(queryElem.typeFilter,fnType.ty)){return false}if(fnType.id<0&&queryElem.id<0){if(mgensIn){if(mgensIn.has(fnType.id)&&mgensIn.get(fnType.id)!==queryElem.id){return false}for(const[fid,qid]of mgensIn.entries()){if(fnType.id!==fid&&queryElem.id===qid){return false}if(fnType.id===fid&&queryElem.id!==qid){return false}}}return true}else{if(queryElem.id===typeNameIdOfArrayOrSlice&&(fnType.id===typeNameIdOfSlice||fnType.id===typeNameIdOfArray)){}else if(queryElem.id===typeNameIdOfTupleOrUnit&&(fnType.id===typeNameIdOfTuple||fnType.id===typeNameIdOfUnit)){}else if(queryElem.id===typeNameIdOfHof&&(fnType.id===typeNameIdOfFn||fnType.id===typeNameIdOfFnMut||fnType.id===typeNameIdOfFnOnce)){}else if(fnType.id!==queryElem.id||queryElem.id===null){return false}if((fnType.generics.length+fnType.bindings.size)===0&&queryElem.generics.length!==0){return false}if(fnType.bindings.size0){const fnTypePath=fnType.path!==undefined&&fnType.path!==null?fnType.path.split("::"):[];if(queryElemPathLength>fnTypePath.length){return false}let i=0;for(const path of fnTypePath){if(path===queryElem.pathWithoutLast[i]){i+=1;if(i>=queryElemPathLength){break}}}if(i0){let mgensSolutionSet=[mgensIn];for(const[name,constraints]of queryElem.bindings.entries()){if(mgensSolutionSet.length===0){return false}if(!fnType.bindings.has(name)){return false}const fnTypeBindings=fnType.bindings.get(name);mgensSolutionSet=mgensSolutionSet.flatMap(mgens=>{const newSolutions=[];unifyFunctionTypes(fnTypeBindings,constraints,whereClause,mgens,newMgens=>{newSolutions.push(newMgens);return false},unboxingDepth,);return newSolutions})}if(mgensSolutionSet.length===0){return false}const binds=Array.from(fnType.bindings.entries()).flatMap(entry=>{const[name,constraints]=entry;if(queryElem.bindings.has(name)){return[]}else{return constraints}});if(simplifiedGenerics.length>0){simplifiedGenerics=[...simplifiedGenerics,...binds]}else{simplifiedGenerics=binds}return{simplifiedGenerics,mgens:mgensSolutionSet}}return{simplifiedGenerics,mgens:[mgensIn]}}function unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth,){if(unboxingDepth>=UNBOXING_LIMIT){return false}if(fnType.id<0&&queryElem.id>=0){if(!whereClause){return false}if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==0){return false}const mgensTmp=new Map(mgens);mgensTmp.set(fnType.id,null);return checkIfInList(whereClause[(-fnType.id)-1],queryElem,whereClause,mgensTmp,unboxingDepth,)}else if(fnType.generics.length>0||fnType.bindings.size>0){const simplifiedGenerics=[...fnType.generics,...Array.from(fnType.bindings.values()).flat(),];return checkIfInList(simplifiedGenerics,queryElem,whereClause,mgens,unboxingDepth,)}return false}function checkIfInList(list,elem,whereClause,mgens,unboxingDepth){for(const entry of list){if(checkType(entry,elem,whereClause,mgens,unboxingDepth)){return true}}return false}function checkType(row,elem,whereClause,mgens,unboxingDepth){if(unboxingDepth>=UNBOXING_LIMIT){return false}if(row.bindings.size===0&&elem.bindings.size===0){if(elem.id<0&&mgens===null){return row.id<0||checkIfInList(row.generics,elem,whereClause,mgens,unboxingDepth+1,)}if(row.id>0&&elem.id>0&&elem.pathWithoutLast.length===0&&typePassesFilter(elem.typeFilter,row.ty)&&elem.generics.length===0&&elem.id!==typeNameIdOfArrayOrSlice&&elem.id!==typeNameIdOfTupleOrUnit&&elem.id!==typeNameIdOfHof){return row.id===elem.id||checkIfInList(row.generics,elem,whereClause,mgens,unboxingDepth,)}}return unifyFunctionTypes([row],[elem],whereClause,mgens,null,unboxingDepth)}function checkPath(contains,ty){if(contains.length===0){return 0}const maxPathEditDistance=Math.floor(contains.reduce((acc,next)=>acc+next.length,0)/3,);let ret_dist=maxPathEditDistance+1;const path=ty.path.split("::");if(ty.parent&&ty.parent.name){path.push(ty.parent.name.toLowerCase())}const length=path.length;const clength=contains.length;pathiter:for(let i=length-clength;i>=0;i-=1){let dist_total=0;for(let x=0;xmaxPathEditDistance){continue pathiter}dist_total+=dist}}ret_dist=Math.min(ret_dist,Math.round(dist_total/clength))}return ret_dist>maxPathEditDistance?null:ret_dist}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER||filter===type)return true;const name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,descShard:item.descShard,descIndex:item.descIndex,exactPath:item.exactPath,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,bitIndex:item.bitIndex,implDisambiguator:item.implDisambiguator,}}function handleAliases(ret,query,filterCrates,currentCrate){const lowerQuery=query.toLowerCase();const aliases=[];const crateAliases=[];if(filterCrates!==null){if(ALIASES.has(filterCrates)&&ALIASES.get(filterCrates).has(lowerQuery)){const query_aliases=ALIASES.get(filterCrates).get(lowerQuery);for(const alias of query_aliases){aliases.push(createAliasFromItem(searchIndex[alias]))}}}else{for(const[crate,crateAliasesIndex]of ALIASES){if(crateAliasesIndex.has(lowerQuery)){const pushTo=crate===currentCrate?crateAliases:aliases;const query_aliases=crateAliasesIndex.get(lowerQuery);for(const alias of query_aliases){pushTo.push(createAliasFromItem(searchIndex[alias]))}}}}const sortFunc=(aaa,bbb)=>{if(aaa.path{alias.alias=query;const res=buildHrefAndPath(alias);alias.displayPath=pathSplitter(res[0]);alias.fullPath=alias.displayPath+alias.name;alias.href=res[1];ret.others.unshift(alias);if(ret.others.length>MAX_RESULTS){ret.others.pop()}};aliases.forEach(pushFunc);crateAliases.forEach(pushFunc)}function addIntoResults(results,fullId,id,index,dist,path_dist,maxEditDistance){if(dist<=maxEditDistance||index!==-1){if(results.has(fullId)){const result=results.get(fullId);if(result.dontValidate||result.dist<=dist){return}}results.set(fullId,{id:id,index:index,dontValidate:parsedQuery.literalSearch,dist:dist,path_dist:path_dist,})}}function handleSingleArg(row,pos,elem,results_others,results_in_args,results_returned,maxEditDistance,){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let path_dist=0;const fullId=row.id;const tfpDist=compareTypeFingerprints(fullId,parsedQuery.typeFingerprint,);if(tfpDist!==null){const in_args=row.type&&row.type.inputs&&checkIfInList(row.type.inputs,elem,row.type.where_clause,null,0);const returned=row.type&&row.type.output&&checkIfInList(row.type.output,elem,row.type.where_clause,null,0);if(in_args){results_in_args.max_dist=Math.max(results_in_args.max_dist||0,tfpDist);const maxDist=results_in_args.sizenormalizedIndex&&normalizedIndex!==-1)){index=normalizedIndex}if(elem.fullPath.length>1){path_dist=checkPath(elem.pathWithoutLast,row);if(path_dist===null){return}}if(parsedQuery.literalSearch){if(row.word===elem.pathLast){addIntoResults(results_others,fullId,pos,index,0,path_dist)}return}const dist=editDistance(row.normalizedName,elem.normalizedPathLast,maxEditDistance);if(index===-1&&dist>maxEditDistance){return}addIntoResults(results_others,fullId,pos,index,dist,path_dist,maxEditDistance)}function handleArgs(row,pos,results){if(!row||(filterCrates!==null&&row.crate!==filterCrates)||!row.type){return}const tfpDist=compareTypeFingerprints(row.id,parsedQuery.typeFingerprint,);if(tfpDist===null){return}if(results.size>=MAX_RESULTS&&tfpDist>results.max_dist){return}if(!unifyFunctionTypes(row.type.inputs,parsedQuery.elems,row.type.where_clause,null,mgens=>{return unifyFunctionTypes(row.type.output,parsedQuery.returned,row.type.where_clause,mgens,null,0,)},0,)){return}results.max_dist=Math.max(results.max_dist||0,tfpDist);addIntoResults(results,row.id,pos,0,tfpDist,0,Number.MAX_VALUE)}function innerRunQuery(){const queryLen=parsedQuery.elems.reduce((acc,next)=>acc+next.pathLast.length,0)+parsedQuery.returned.reduce((acc,next)=>acc+next.pathLast.length,0);const maxEditDistance=Math.floor(queryLen/3);const genericSymbols=new Map();function convertNameToId(elem,isAssocType){if(typeNameIdMap.has(elem.normalizedPathLast)&&(isAssocType||!typeNameIdMap.get(elem.normalizedPathLast).assocOnly)){elem.id=typeNameIdMap.get(elem.normalizedPathLast).id}else if(!parsedQuery.literalSearch){let match=null;let matchDist=maxEditDistance+1;let matchName="";for(const[name,{id,assocOnly}]of typeNameIdMap){const dist=editDistance(name,elem.normalizedPathLast,maxEditDistance);if(dist<=matchDist&&dist<=maxEditDistance&&(isAssocType||!assocOnly)){if(dist===matchDist&&matchName>name){continue}match=id;matchDist=dist;matchName=name}}if(match!==null){parsedQuery.correction=matchName}elem.id=match}if((elem.id===null&&parsedQuery.totalElems>1&&elem.typeFilter===-1&&elem.generics.length===0&&elem.bindings.size===0)||elem.typeFilter===TY_GENERIC){if(genericSymbols.has(elem.name)){elem.id=genericSymbols.get(elem.name)}else{elem.id=-(genericSymbols.size+1);genericSymbols.set(elem.name,elem.id)}if(elem.typeFilter===-1&&elem.name.length>=3){const maxPartDistance=Math.floor(elem.name.length/3);let matchDist=maxPartDistance+1;let matchName="";for(const name of typeNameIdMap.keys()){const dist=editDistance(name,elem.name,maxPartDistance);if(dist<=matchDist&&dist<=maxPartDistance){if(dist===matchDist&&matchName>name){continue}matchDist=dist;matchName=name}}if(matchName!==""){parsedQuery.proposeCorrectionFrom=elem.name;parsedQuery.proposeCorrectionTo=matchName}}elem.typeFilter=TY_GENERIC}if(elem.generics.length>0&&elem.typeFilter===TY_GENERIC){parsedQuery.error=["Generic type parameter ",elem.name," does not accept generic parameters",]}for(const elem2 of elem.generics){convertNameToId(elem2)}elem.bindings=new Map(Array.from(elem.bindings.entries()).map(entry=>{const[name,constraints]=entry;if(!typeNameIdMap.has(name)){parsedQuery.error=["Type parameter ",name," does not exist",];return[null,[]]}for(const elem2 of constraints){convertNameToId(elem2)}return[typeNameIdMap.get(name).id,constraints]}),)}const fps=new Set();for(const elem of parsedQuery.elems){convertNameToId(elem);buildFunctionTypeFingerprint(elem,parsedQuery.typeFingerprint,fps)}for(const elem of parsedQuery.returned){convertNameToId(elem);buildFunctionTypeFingerprint(elem,parsedQuery.typeFingerprint,fps)}if(parsedQuery.foundElems===1&&parsedQuery.returned.length===0){if(parsedQuery.elems.length===1){const elem=parsedQuery.elems[0];for(let i=0,nSearchIndex=searchIndex.length;i0){const sortQ=(a,b)=>{const ag=a.generics.length===0&&a.bindings.size===0;const bg=b.generics.length===0&&b.bindings.size===0;if(ag!==bg){return ag-bg}const ai=a.id>0;const bi=b.id>0;return ai-bi};parsedQuery.elems.sort(sortQ);parsedQuery.returned.sort(sortQ);for(let i=0,nSearchIndex=searchIndex.length;i{const descs=await Promise.all(list.map(result=>{return searchIndexEmptyDesc.get(result.crate).contains(result.bitIndex)?"":searchState.loadDesc(result)}));for(const[i,result]of list.entries()){result.desc=descs[i]}}));if(parsedQuery.error!==null&&ret.others.length!==0){ret.query.error=null}return ret}function nextTab(direction){const next=(searchState.currentTab+direction+3)%searchState.focusedByTab.length;searchState.focusedByTab[searchState.currentTab]=document.activeElement;printTab(next);focusSearchResult()}function focusSearchResult(){const target=searchState.focusedByTab[searchState.currentTab]||document.querySelectorAll(".search-results.active a").item(0)||document.querySelectorAll("#search-tabs button").item(searchState.currentTab);searchState.focusedByTab[searchState.currentTab]=null;if(target){target.focus()}}function buildHrefAndPath(item){let displayPath;let href;const type=itemTypes[item.ty];const name=item.name;let path=item.path;let exactPath=item.exactPath;if(type==="mod"){displayPath=path+"::";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="import"){displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/index.html#reexport."+name}else if(type==="primitive"||type==="keyword"){displayPath="";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=ROOT_PATH+name+"/index.html"}else if(item.parent!==undefined){const myparent=item.parent;let anchor=type+"."+name;const parentType=itemTypes[myparent.ty];let pageType=parentType;let pageName=myparent.name;exactPath=`${myparent.exactPath}::${myparent.name}`;if(parentType==="primitive"){displayPath=myparent.name+"::"}else if(type==="structfield"&&parentType==="variant"){const enumNameIdx=item.path.lastIndexOf("::");const enumName=item.path.substr(enumNameIdx+2);path=item.path.substr(0,enumNameIdx);displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}if(item.implDisambiguator!==null){anchor=item.implDisambiguator+"/"+anchor}href=ROOT_PATH+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html#"+anchor}else{displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href,`${exactPath}::${name}`]}function pathSplitter(path){const tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}async function addTab(array,query,display){const extraClass=display?" active":"";const output=document.createElement("div");if(array.length>0){output.className="search-results "+extraClass;for(const item of array){const name=item.name;const type=itemTypes[item.ty];const longType=longItemTypes[item.ty];const typeName=longType.length!==0?`${longType}`:"?";const link=document.createElement("a");link.className="result-"+type;link.href=item.href;const resultName=document.createElement("div");resultName.className="result-name";resultName.insertAdjacentHTML("beforeend",`${typeName}`);link.appendChild(resultName);let alias=" ";if(item.is_alias){alias=`
\ +${item.alias} - see \ +
`}resultName.insertAdjacentHTML("beforeend",`
${alias}\ +${item.displayPath}${name}\ +
`);const description=document.createElement("div");description.className="desc";description.insertAdjacentHTML("beforeend",item.desc);link.appendChild(description);output.appendChild(link)}}else if(query.error===null){output.className="search-failed"+extraClass;output.innerHTML="No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:"}return[output,array.length]}function makeTabHeader(tabNb,text,nbElems){const fmtNbElems=nbElems<10?`\u{2007}(${nbElems})\u{2007}\u{2007}`:nbElems<100?`\u{2007}(${nbElems})\u{2007}`:`\u{2007}(${nbElems})`;if(searchState.currentTab===tabNb){return""}return""}async function showResults(results,go_to_first,filterCrates){const search=searchState.outputElement();if(go_to_first||(results.others.length===1&&getSettingValue("go-to-only-result")==="true")){window.onunload=()=>{};searchState.removeQueryParameters();const elem=document.createElement("a");elem.href=results.others[0].href;removeClass(elem,"active");document.body.appendChild(elem);elem.click();return}if(results.query===undefined){results.query=parseQuery(searchState.input.value)}currentResults=results.query.userQuery;const[ret_others,ret_in_args,ret_returned]=await Promise.all([addTab(results.others,results.query,true),addTab(results.in_args,results.query,false),addTab(results.returned,results.query,false),]);let currentTab=searchState.currentTab;if((currentTab===0&&ret_others[1]===0)||(currentTab===1&&ret_in_args[1]===0)||(currentTab===2&&ret_returned[1]===0)){if(ret_others[1]!==0){currentTab=0}else if(ret_in_args[1]!==0){currentTab=1}else if(ret_returned[1]!==0){currentTab=2}}let crates="";if(rawSearchIndex.size>1){crates=" in 
"}let output=`

Results${crates}

`;if(results.query.error!==null){const error=results.query.error;error.forEach((value,index)=>{value=value.split("<").join("<").split(">").join(">");if(index%2!==0){error[index]=`${value.replaceAll(" ", " ")}`}else{error[index]=value}});output+=`

Query parser error: "${error.join("")}".

`;output+="
"+makeTabHeader(0,"In Names",ret_others[1])+"
";currentTab=0}else if(results.query.foundElems<=1&&results.query.returned.length===0){output+="
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
"}else{const signatureTabTitle=results.query.elems.length===0?"In Function Return Types":results.query.returned.length===0?"In Function Parameters":"In Function Signatures";output+="
"+makeTabHeader(0,signatureTabTitle,ret_others[1])+"
";currentTab=0}if(results.query.correction!==null){const orig=results.query.returned.length>0?results.query.returned[0].name:results.query.elems[0].name;output+="

"+`Type "${orig}" not found. `+"Showing results for closest type name "+`"${results.query.correction}" instead.

`}if(results.query.proposeCorrectionFrom!==null){const orig=results.query.proposeCorrectionFrom;const targ=results.query.proposeCorrectionTo;output+="

"+`Type "${orig}" not found and used as generic parameter. `+`Consider searching for "${targ}" instead.

`}const resultsElem=document.createElement("div");resultsElem.id="results";resultsElem.appendChild(ret_others[0]);resultsElem.appendChild(ret_in_args[0]);resultsElem.appendChild(ret_returned[0]);search.innerHTML=output;const crateSearch=document.getElementById("crate-search");if(crateSearch){crateSearch.addEventListener("input",updateCrate)}search.appendChild(resultsElem);searchState.showResults(search);const elems=document.getElementById("search-tabs").childNodes;searchState.focusedByTab=[];let i=0;for(const elem of elems){const j=i;elem.onclick=()=>printTab(j);searchState.focusedByTab.push(null);i+=1}printTab(currentTab)}function updateSearchHistory(url){if(!browserSupportsHistoryApi()){return}const params=searchState.getQueryStringParams();if(!history.state&&!params.search){history.pushState(null,"",url)}else{history.replaceState(null,"",url)}}async function search(forced){const query=parseQuery(searchState.input.value.trim());let filterCrates=getFilterCrates();if(!forced&&query.userQuery===currentResults){if(query.userQuery.length>0){putBackSearch()}return}searchState.setLoadingSearch();const params=searchState.getQueryStringParams();if(filterCrates===null&¶ms["filter-crate"]!==undefined){filterCrates=params["filter-crate"]}searchState.title="Results for "+query.original+" - Rust";updateSearchHistory(buildUrl(query.original,filterCrates));await showResults(await execQuery(query,filterCrates,window.currentCrate),params.go_to_first,filterCrates)}function buildItemSearchTypeAll(types,lowercasePaths){return types.length>0?types.map(type=>buildItemSearchType(type,lowercasePaths)):EMPTY_GENERICS_ARRAY}const EMPTY_BINDINGS_MAP=new Map();const EMPTY_GENERICS_ARRAY=[];let TYPES_POOL=new Map();function buildItemSearchType(type,lowercasePaths,isAssocType){const PATH_INDEX_DATA=0;const GENERICS_DATA=1;const BINDINGS_DATA=2;let pathIndex,generics,bindings;if(typeof type==="number"){pathIndex=type;generics=EMPTY_GENERICS_ARRAY;bindings=EMPTY_BINDINGS_MAP}else{pathIndex=type[PATH_INDEX_DATA];generics=buildItemSearchTypeAll(type[GENERICS_DATA],lowercasePaths,);if(type.length>BINDINGS_DATA&&type[BINDINGS_DATA].length>0){bindings=new Map(type[BINDINGS_DATA].map(binding=>{const[assocType,constraints]=binding;return[buildItemSearchType(assocType,lowercasePaths,true).id,buildItemSearchTypeAll(constraints,lowercasePaths),]}))}else{bindings=EMPTY_BINDINGS_MAP}}let result;if(pathIndex<0){result={id:pathIndex,ty:TY_GENERIC,path:null,exactPath:null,generics,bindings,}}else if(pathIndex===0){result={id:null,ty:null,path:null,exactPath:null,generics,bindings,}}else{const item=lowercasePaths[pathIndex-1];result={id:buildTypeMapIndex(item.name,isAssocType),ty:item.ty,path:item.path,exactPath:item.exactPath,generics,bindings,}}const cr=TYPES_POOL.get(result.id);if(cr){if(cr.generics.length===result.generics.length&&cr.generics!==result.generics&&cr.generics.every((x,i)=>result.generics[i]===x)){result.generics=cr.generics}if(cr.bindings.size===result.bindings.size&&cr.bindings!==result.bindings){let ok=true;for(const[k,v]of cr.bindings.entries()){const v2=result.bindings.get(v);if(!v2){ok=false;break}if(v!==v2&&v.length===v2.length&&v.every((x,i)=>v2[i]===x)){result.bindings.set(k,v)}else if(v!==v2){ok=false;break}}if(ok){result.bindings=cr.bindings}}if(cr.ty===result.ty&&cr.path===result.path&&cr.bindings===result.bindings&&cr.generics===result.generics&&cr.ty===result.ty){return cr}}TYPES_POOL.set(result.id,result);return result}function buildFunctionSearchTypeCallback(lowercasePaths){return functionSearchType=>{if(functionSearchType===0){return null}const INPUTS_DATA=0;const OUTPUT_DATA=1;let inputs,output;if(typeof functionSearchType[INPUTS_DATA]==="number"){inputs=[buildItemSearchType(functionSearchType[INPUTS_DATA],lowercasePaths)]}else{inputs=buildItemSearchTypeAll(functionSearchType[INPUTS_DATA],lowercasePaths,)}if(functionSearchType.length>1){if(typeof functionSearchType[OUTPUT_DATA]==="number"){output=[buildItemSearchType(functionSearchType[OUTPUT_DATA],lowercasePaths)]}else{output=buildItemSearchTypeAll(functionSearchType[OUTPUT_DATA],lowercasePaths,)}}else{output=[]}const where_clause=[];const l=functionSearchType.length;for(let i=2;i{k=(~~k+0x7ed55d16)+(k<<12);k=(k ^ 0xc761c23c)^(k>>>19);k=(~~k+0x165667b1)+(k<<5);k=(~~k+0xd3a2646c)^(k<<9);k=(~~k+0xfd7046c5)+(k<<3);return(k ^ 0xb55a4f09)^(k>>>16)};const hashint2=k=>{k=~k+(k<<15);k ^=k>>>12;k+=k<<2;k ^=k>>>4;k=Math.imul(k,2057);return k ^(k>>16)};if(input!==null){const h0a=hashint1(input);const h0b=hashint2(input);const h1a=~~(h0a+Math.imul(h0b,2));const h1b=~~(h0a+Math.imul(h0b,3));const h2a=~~(h0a+Math.imul(h0b,4));const h2b=~~(h0a+Math.imul(h0b,5));output[0]|=(1<<(h0a%32))|(1<<(h1b%32));output[1]|=(1<<(h1a%32))|(1<<(h2b%32));output[2]|=(1<<(h2a%32))|(1<<(h0b%32));fps.add(input)}for(const g of type.generics){buildFunctionTypeFingerprint(g,output,fps)}const fb={id:null,ty:0,generics:EMPTY_GENERICS_ARRAY,bindings:EMPTY_BINDINGS_MAP,};for(const[k,v]of type.bindings.entries()){fb.id=k;fb.generics=v;buildFunctionTypeFingerprint(fb,output,fps)}output[3]=fps.size}function compareTypeFingerprints(fullId,queryFingerprint){const fh0=functionTypeFingerprint[fullId*4];const fh1=functionTypeFingerprint[(fullId*4)+1];const fh2=functionTypeFingerprint[(fullId*4)+2];const[qh0,qh1,qh2]=queryFingerprint;const[in0,in1,in2]=[fh0&qh0,fh1&qh1,fh2&qh2];if((in0 ^ qh0)||(in1 ^ qh1)||(in2 ^ qh2)){return null}return functionTypeFingerprint[(fullId*4)+3]}class VlqHexDecoder{constructor(string,cons){this.string=string;this.cons=cons;this.offset=0;this.backrefQueue=[]}decodeList(){const cb="}".charCodeAt(0);let c=this.string.charCodeAt(this.offset);const ret=[];while(c!==cb){ret.push(this.decode());c=this.string.charCodeAt(this.offset)}this.offset+=1;return ret}decode(){const[ob,la]=["{","`"].map(c=>c.charCodeAt(0));let n=0;let c=this.string.charCodeAt(this.offset);if(c===ob){this.offset+=1;return this.decodeList()}while(c>1];this.offset+=1;return sign?-value:value}next(){const c=this.string.charCodeAt(this.offset);const[zero,ua,la]=["0","@","`"].map(c=>c.charCodeAt(0));if(c>=zero&&c16){this.backrefQueue.pop()}return result}}class RoaringBitmap{constructor(str){const strdecoded=atob(str);const u8array=new Uint8Array(strdecoded.length);for(let j=0;j=4){offsets=[];for(let j=0;j>3]&(1<<(j&0x7))){const runcount=(u8array[i]|(u8array[i+1]<<8));i+=2;this.containers.push(new RoaringBitmapRun(runcount,u8array.slice(i,i+(runcount*4)),));i+=runcount*4}else if(this.cardinalities[j]>=4096){this.containers.push(new RoaringBitmapBits(u8array.slice(i,i+8192)));i+=8192}else{const end=this.cardinalities[j]*2;this.containers.push(new RoaringBitmapArray(this.cardinalities[j],u8array.slice(i,i+end),));i+=end}}}contains(keyvalue){const key=keyvalue>>16;const value=keyvalue&0xFFFF;for(let i=0;i=start&&value<=(start+lenm1)){return true}}return false}}class RoaringBitmapArray{constructor(cardinality,array){this.cardinality=cardinality;this.array=array}contains(value){const l=this.cardinality*2;for(let i=0;i>3]&(1<<(value&7)))}}function buildIndex(rawSearchIndex){searchIndex=[];searchIndexDeprecated=new Map();searchIndexEmptyDesc=new Map();const charA="A".charCodeAt(0);let currentIndex=0;let id=0;for(const crate of rawSearchIndex.values()){id+=crate.t.length+1}functionTypeFingerprint=new Uint32Array((id+1)*4);id=0;for(const[crate,crateCorpus]of rawSearchIndex){const itemDescShardDecoder=new VlqHexDecoder(crateCorpus.D,noop=>noop);let descShard={crate,shard:0,start:0,len:itemDescShardDecoder.next(),promise:null,resolve:null,};const descShardList=[descShard];searchIndexDeprecated.set(crate,new RoaringBitmap(crateCorpus.c));searchIndexEmptyDesc.set(crate,new RoaringBitmap(crateCorpus.e));let descIndex=0;const crateRow={crate,ty:3,name:crate,path:"",descShard,descIndex,exactPath:"",desc:crateCorpus.doc,parent:undefined,type:null,id,word:crate,normalizedName:crate.indexOf("_")===-1?crate:crate.replace(/_/g,""),bitIndex:0,implDisambiguator:null,};id+=1;searchIndex.push(crateRow);currentIndex+=1;if(!searchIndexEmptyDesc.get(crate).contains(0)){descIndex+=1}const itemTypes=crateCorpus.t;const itemNames=crateCorpus.n;const itemPaths=new Map(crateCorpus.q);const itemReexports=new Map(crateCorpus.r);const itemParentIdxs=crateCorpus.i;const implDisambiguator=new Map(crateCorpus.b);const paths=crateCorpus.p;const aliases=crateCorpus.a;const lowercasePaths=[];const itemFunctionDecoder=new VlqHexDecoder(crateCorpus.f,buildFunctionSearchTypeCallback(lowercasePaths),);let len=paths.length;let lastPath=itemPaths.get(0);for(let i=0;i2){path=itemPaths.has(elem[2])?itemPaths.get(elem[2]):lastPath;lastPath=path}const exactPath=elem.length>3?itemPaths.get(elem[3]):path;lowercasePaths.push({ty,name:name.toLowerCase(),path,exactPath});paths[i]={ty,name,path,exactPath}}lastPath="";len=itemTypes.length;for(let i=0;i=descShard.len&&!searchIndexEmptyDesc.get(crate).contains(bitIndex)){descShard={crate,shard:descShard.shard+1,start:descShard.start+descShard.len,len:itemDescShardDecoder.next(),promise:null,resolve:null,};descIndex=0;descShardList.push(descShard)}let word="";if(typeof itemNames[i]==="string"){word=itemNames[i].toLowerCase()}const path=itemPaths.has(i)?itemPaths.get(i):lastPath;const type=itemFunctionDecoder.next();if(type!==null){if(type){const fp=functionTypeFingerprint.subarray(id*4,(id+1)*4);const fps=new Set();for(const t of type.inputs){buildFunctionTypeFingerprint(t,fp,fps)}for(const t of type.output){buildFunctionTypeFingerprint(t,fp,fps)}for(const w of type.where_clause){for(const t of w){buildFunctionTypeFingerprint(t,fp,fps)}}}}const row={crate,ty:itemTypes.charCodeAt(i)-charA,name:itemNames[i],path,descShard,descIndex,exactPath:itemReexports.has(i)?itemPaths.get(itemReexports.get(i)):path,parent:itemParentIdxs[i]>0?paths[itemParentIdxs[i]-1]:undefined,type,id,word,normalizedName:word.indexOf("_")===-1?word:word.replace(/_/g,""),bitIndex,implDisambiguator:implDisambiguator.has(i)?implDisambiguator.get(i):null,};id+=1;searchIndex.push(row);lastPath=row.path;if(!searchIndexEmptyDesc.get(crate).contains(bitIndex)){descIndex+=1}}if(aliases){const currentCrateAliases=new Map();ALIASES.set(crate,currentCrateAliases);for(const alias_name in aliases){if(!Object.prototype.hasOwnProperty.call(aliases,alias_name)){continue}let currentNameAliases;if(currentCrateAliases.has(alias_name)){currentNameAliases=currentCrateAliases.get(alias_name)}else{currentNameAliases=[];currentCrateAliases.set(alias_name,currentNameAliases)}for(const local_alias of aliases[alias_name]){currentNameAliases.push(local_alias+currentIndex)}}}currentIndex+=itemTypes.length;searchState.descShards.set(crate,descShardList)}TYPES_POOL=new Map()}function onSearchSubmit(e){e.preventDefault();searchState.clearInputTimeout();search()}function putBackSearch(){const search_input=searchState.input;if(!searchState.input){return}if(search_input.value!==""&&!searchState.isDisplayed()){searchState.showResults();if(browserSupportsHistoryApi()){history.replaceState(null,"",buildUrl(search_input.value,getFilterCrates()))}document.title=searchState.title}}function registerSearchEvents(){const params=searchState.getQueryStringParams();if(searchState.input.value===""){searchState.input.value=params.search||""}const searchAfter500ms=()=>{searchState.clearInputTimeout();if(searchState.input.value.length===0){searchState.hideResults()}else{searchState.timeout=setTimeout(search,500)}};searchState.input.onkeyup=searchAfter500ms;searchState.input.oninput=searchAfter500ms;document.getElementsByClassName("search-form")[0].onsubmit=onSearchSubmit;searchState.input.onchange=e=>{if(e.target!==document.activeElement){return}searchState.clearInputTimeout();setTimeout(search,0)};searchState.input.onpaste=searchState.input.onchange;searchState.outputElement().addEventListener("keydown",e=>{if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey){return}if(e.which===38){const previous=document.activeElement.previousElementSibling;if(previous){previous.focus()}else{searchState.focus()}e.preventDefault()}else if(e.which===40){const next=document.activeElement.nextElementSibling;if(next){next.focus()}const rect=document.activeElement.getBoundingClientRect();if(window.innerHeight-rect.bottom{if(e.which===40){focusSearchResult();e.preventDefault()}});searchState.input.addEventListener("focus",()=>{putBackSearch()});searchState.input.addEventListener("blur",()=>{searchState.input.placeholder=searchState.input.origPlaceholder});if(browserSupportsHistoryApi()){const previousTitle=document.title;window.addEventListener("popstate",e=>{const params=searchState.getQueryStringParams();document.title=previousTitle;currentResults=null;if(params.search&¶ms.search.length>0){searchState.input.value=params.search;e.preventDefault();search()}else{searchState.input.value="";searchState.hideResults()}})}window.onpageshow=()=>{const qSearch=searchState.getQueryStringParams().search;if(searchState.input.value===""&&qSearch){searchState.input.value=qSearch}search()}}function updateCrate(ev){if(ev.target.value==="all crates"){const query=searchState.input.value.trim();updateSearchHistory(buildUrl(query,null))}currentResults=null;search(true)}buildIndex(rawSearchIndex);if(typeof window!=="undefined"){registerSearchEvents();if(window.searchState.getQueryStringParams().search){search()}}if(typeof exports!=="undefined"){exports.initSearch=initSearch;exports.execQuery=execQuery;exports.parseQuery=parseQuery}}if(typeof window!=="undefined"){window.initSearch=initSearch;if(window.searchIndex!==undefined){initSearch(window.searchIndex)}}else{initSearch(new Map())}})() \ No newline at end of file diff --git a/docs/static.files/settings-4313503d2e1961c2.js b/docs/static.files/settings-4313503d2e1961c2.js new file mode 100644 index 00000000..ab425fe4 --- /dev/null +++ b/docs/static.files/settings-4313503d2e1961c2.js @@ -0,0 +1,17 @@ +"use strict";(function(){const isSettingsPage=window.location.pathname.endsWith("/settings.html");function changeSetting(settingName,value){if(settingName==="theme"){const useSystem=value==="system preference"?"true":"false";updateLocalStorage("use-system-theme",useSystem)}updateLocalStorage(settingName,value);switch(settingName){case"theme":case"preferred-dark-theme":case"preferred-light-theme":updateTheme();updateLightAndDark();break;case"line-numbers":if(value===true){window.rustdoc_add_line_numbers_to_examples()}else{window.rustdoc_remove_line_numbers_from_examples()}break;case"hide-sidebar":if(value===true){addClass(document.documentElement,"hide-sidebar")}else{removeClass(document.documentElement,"hide-sidebar")}break}}function showLightAndDark(){removeClass(document.getElementById("preferred-light-theme"),"hidden");removeClass(document.getElementById("preferred-dark-theme"),"hidden")}function hideLightAndDark(){addClass(document.getElementById("preferred-light-theme"),"hidden");addClass(document.getElementById("preferred-dark-theme"),"hidden")}function updateLightAndDark(){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||(useSystem===null&&getSettingValue("theme")===null)){showLightAndDark()}else{hideLightAndDark()}}function setEvents(settingsElement){updateLightAndDark();onEachLazy(settingsElement.querySelectorAll("input[type=\"checkbox\"]"),toggle=>{const settingId=toggle.id;const settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true"}toggle.onchange=()=>{changeSetting(toggle.id,toggle.checked)}});onEachLazy(settingsElement.querySelectorAll("input[type=\"radio\"]"),elem=>{const settingId=elem.name;let settingValue=getSettingValue(settingId);if(settingId==="theme"){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||settingValue===null){settingValue=useSystem==="false"?"light":"system preference"}}if(settingValue!==null&&settingValue!=="null"){elem.checked=settingValue===elem.value}elem.addEventListener("change",ev=>{changeSetting(ev.target.name,ev.target.value)})})}function buildSettingsPageSections(settings){let output="";for(const setting of settings){const js_data_name=setting["js_name"];const setting_name=setting["name"];if(setting["options"]!==undefined){output+=`\ +
+
${setting_name}
+
`;onEach(setting["options"],option=>{const checked=option===setting["default"]?" checked":"";const full=`${js_data_name}-${option.replace(/ /g,"-")}`;output+=`\ + `});output+=`\ +
+
`}else{const checked=setting["default"]===true?" checked":"";output+=`\ +
\ + \ +
`}}return output}function buildSettingsPage(){const theme_names=getVar("themes").split(",").filter(t=>t);theme_names.push("light","dark","ayu");const settings=[{"name":"Theme","js_name":"theme","default":"system preference","options":theme_names.concat("system preference"),},{"name":"Preferred light theme","js_name":"preferred-light-theme","default":"light","options":theme_names,},{"name":"Preferred dark theme","js_name":"preferred-dark-theme","default":"dark","options":theme_names,},{"name":"Auto-hide item contents for large items","js_name":"auto-hide-large-items","default":true,},{"name":"Auto-hide item methods' documentation","js_name":"auto-hide-method-docs","default":false,},{"name":"Auto-hide trait implementation documentation","js_name":"auto-hide-trait-implementations","default":false,},{"name":"Directly go to item in search if there is only one result","js_name":"go-to-only-result","default":false,},{"name":"Show line numbers on code examples","js_name":"line-numbers","default":false,},{"name":"Hide persistent navigation bar","js_name":"hide-sidebar","default":false,},{"name":"Disable keyboard shortcuts","js_name":"disable-shortcuts","default":false,},];const elementKind=isSettingsPage?"section":"div";const innerHTML=`
${buildSettingsPageSections(settings)}
`;const el=document.createElement(elementKind);el.id="settings";if(!isSettingsPage){el.className="popover"}el.innerHTML=innerHTML;if(isSettingsPage){document.getElementById(MAIN_ID).appendChild(el)}else{el.setAttribute("tabindex","-1");getSettingsButton().appendChild(el)}return el}const settingsMenu=buildSettingsPage();function displaySettings(){settingsMenu.style.display="";onEachLazy(settingsMenu.querySelectorAll("input[type='checkbox']"),el=>{const val=getSettingValue(el.id);const checked=val==="true";if(checked!==el.checked&&val!==null){el.checked=checked}})}function settingsBlurHandler(event){blurHandler(event,getSettingsButton(),window.hidePopoverMenus)}if(isSettingsPage){getSettingsButton().onclick=event=>{event.preventDefault()}}else{const settingsButton=getSettingsButton();const settingsMenu=document.getElementById("settings");settingsButton.onclick=event=>{if(settingsMenu.contains(event.target)){return}event.preventDefault();const shouldDisplaySettings=settingsMenu.style.display==="none";window.hideAllModals();if(shouldDisplaySettings){displaySettings()}};settingsButton.onblur=settingsBlurHandler;settingsButton.querySelector("a").onblur=settingsBlurHandler;onEachLazy(settingsMenu.querySelectorAll("input"),el=>{el.onblur=settingsBlurHandler});settingsMenu.onblur=settingsBlurHandler}setTimeout(()=>{setEvents(settingsMenu);if(!isSettingsPage){displaySettings()}removeClass(getSettingsButton(),"rotate")},0)})() \ No newline at end of file diff --git a/docs/static.files/src-script-e66d777a5a92e9b2.js b/docs/static.files/src-script-e66d777a5a92e9b2.js new file mode 100644 index 00000000..d0aebb85 --- /dev/null +++ b/docs/static.files/src-script-e66d777a5a92e9b2.js @@ -0,0 +1 @@ +"use strict";(function(){const rootPath=getVar("root-path");const NAME_OFFSET=0;const DIRS_OFFSET=1;const FILES_OFFSET=2;const RUSTDOC_MOBILE_BREAKPOINT=700;function closeSidebarIfMobile(){if(window.innerWidth{removeClass(document.documentElement,"src-sidebar-expanded");updateLocalStorage("source-sidebar-show","false")};window.rustdocShowSourceSidebar=()=>{addClass(document.documentElement,"src-sidebar-expanded");updateLocalStorage("source-sidebar-show","true")};window.rustdocToggleSrcSidebar=()=>{if(document.documentElement.classList.contains("src-sidebar-expanded")){window.rustdocCloseSourceSidebar()}else{window.rustdocShowSourceSidebar()}};function createSrcSidebar(){const container=document.querySelector("nav.sidebar");const sidebar=document.createElement("div");sidebar.id="src-sidebar";let hasFoundFile=false;for(const[key,source]of srcIndex){source[NAME_OFFSET]=key;hasFoundFile=createDirEntry(source,sidebar,"",hasFoundFile)}container.appendChild(sidebar);const selected_elem=sidebar.getElementsByClassName("selected")[0];if(typeof selected_elem!=="undefined"){selected_elem.focus()}}function highlightSrcLines(){const match=window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/);if(!match){return}let from=parseInt(match[1],10);let to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to{onEachLazy(e.getElementsByTagName("a"),i_e=>{removeClass(i_e,"line-highlighted")})});for(let i=from;i<=to;++i){elem=document.getElementById(i);if(!elem){break}addClass(elem,"line-highlighted")}}const handleSrcHighlight=(function(){let prev_line_id=0;const set_fragment=name=>{const x=window.scrollX,y=window.scrollY;if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSrcLines()}else{location.replace("#"+name)}window.scrollTo(x,y)};return ev=>{let cur_line_id=parseInt(ev.target.id,10);if(isNaN(cur_line_id)||ev.ctrlKey||ev.altKey||ev.metaKey){return}ev.preventDefault();if(ev.shiftKey&&prev_line_id){if(prev_line_id>cur_line_id){const tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());window.addEventListener("hashchange",highlightSrcLines);onEachLazy(document.getElementsByClassName("src-line-numbers"),el=>{el.addEventListener("click",handleSrcHighlight)});highlightSrcLines();window.createSrcSidebar=createSrcSidebar})() \ No newline at end of file diff --git a/docs/static.files/storage-e32f0c247825364d.js b/docs/static.files/storage-e32f0c247825364d.js new file mode 100644 index 00000000..61ddce23 --- /dev/null +++ b/docs/static.files/storage-e32f0c247825364d.js @@ -0,0 +1 @@ +"use strict";const builtinThemes=["light","dark","ayu"];const darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");const settingsDataset=(function(){const settingsElement=document.getElementById("default-settings");return settingsElement&&settingsElement.dataset?settingsElement.dataset:null})();function getSettingValue(settingName){const current=getCurrentValue(settingName);if(current===null&&settingsDataset!==null){const def=settingsDataset[settingName.replace(/-/g,"_")];if(def!==undefined){return def}}return current}const localStoredTheme=getSettingValue("theme");function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(elem&&elem.classList){elem.classList.add(className)}}function removeClass(elem,className){if(elem&&elem.classList){elem.classList.remove(className)}}function onEach(arr,func){for(const elem of arr){if(func(elem)){return true}}return false}function onEachLazy(lazyArray,func){return onEach(Array.prototype.slice.call(lazyArray),func)}function updateLocalStorage(name,value){try{window.localStorage.setItem("rustdoc-"+name,value)}catch(e){}}function getCurrentValue(name){try{return window.localStorage.getItem("rustdoc-"+name)}catch(e){return null}}const getVar=(function getVar(name){const el=document.querySelector("head > meta[name='rustdoc-vars']");return el?el.attributes["data-"+name].value:null});function switchTheme(newThemeName,saveTheme){const themeNames=getVar("themes").split(",").filter(t=>t);themeNames.push(...builtinThemes);if(themeNames.indexOf(newThemeName)===-1){return}if(saveTheme){updateLocalStorage("theme",newThemeName)}document.documentElement.setAttribute("data-theme",newThemeName);if(builtinThemes.indexOf(newThemeName)!==-1){if(window.currentTheme){window.currentTheme.parentNode.removeChild(window.currentTheme);window.currentTheme=null}}else{const newHref=getVar("root-path")+encodeURIComponent(newThemeName)+getVar("resource-suffix")+".css";if(!window.currentTheme){if(document.readyState==="loading"){document.write(``);window.currentTheme=document.getElementById("themeStyle")}else{window.currentTheme=document.createElement("link");window.currentTheme.rel="stylesheet";window.currentTheme.id="themeStyle";window.currentTheme.href=newHref;document.documentElement.appendChild(window.currentTheme)}}else if(newHref!==window.currentTheme.href){window.currentTheme.href=newHref}}}const updateTheme=(function(){const mql=window.matchMedia("(prefers-color-scheme: dark)");function updateTheme(){if(getSettingValue("use-system-theme")!=="false"){const lightTheme=getSettingValue("preferred-light-theme")||"light";const darkTheme=getSettingValue("preferred-dark-theme")||"dark";updateLocalStorage("use-system-theme","true");switchTheme(mql.matches?darkTheme:lightTheme,true)}else{switchTheme(getSettingValue("theme"),false)}}mql.addEventListener("change",updateTheme);return updateTheme})();if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("preferred-dark-theme",localStoredTheme)}}updateTheme();if(getSettingValue("source-sidebar-show")==="true"){addClass(document.documentElement,"src-sidebar-expanded")}if(getSettingValue("hide-sidebar")==="true"){addClass(document.documentElement,"hide-sidebar")}function updateSidebarWidth(){const desktopSidebarWidth=getSettingValue("desktop-sidebar-width");if(desktopSidebarWidth&&desktopSidebarWidth!=="null"){document.documentElement.style.setProperty("--desktop-sidebar-width",desktopSidebarWidth+"px",)}const srcSidebarWidth=getSettingValue("src-sidebar-width");if(srcSidebarWidth&&srcSidebarWidth!=="null"){document.documentElement.style.setProperty("--src-sidebar-width",srcSidebarWidth+"px",)}}updateSidebarWidth();window.addEventListener("pageshow",ev=>{if(ev.persisted){setTimeout(updateTheme,0);setTimeout(updateSidebarWidth,0)}}) \ No newline at end of file diff --git a/docs/static.files/wheel-63255fc4502dca9a.svg b/docs/static.files/wheel-63255fc4502dca9a.svg new file mode 100644 index 00000000..ba30f13d --- /dev/null +++ b/docs/static.files/wheel-63255fc4502dca9a.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/trait.impl/core/clone/trait.Clone.js b/docs/trait.impl/core/clone/trait.Clone.js new file mode 100644 index 00000000..b26e9894 --- /dev/null +++ b/docs/trait.impl/core/clone/trait.Clone.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl Clone for Change"],["impl Clone for Literal"],["impl Clone for Subdatatypes"],["impl Clone for ImpossibleConstraint"],["impl Clone for ExtractReport"],["impl Clone for RunMode"],["impl Clone for SerializedNode"],["impl Clone for Term"],["impl Clone for Span"],["impl Clone for IdentSort"],["impl Clone for ResolvedVar"],["impl Clone for Schema"],["impl Clone for Variant"],["impl Clone for EGraph"],["impl Clone for Function"],["impl Clone for Primitive"],["impl Clone for RunReport"],["impl Clone for TermDag"],["impl Clone for TypeInfo"],["impl Clone for Value"],["impl Clone for SymbolGen"],["impl<Head, Leaf> Clone for GenericAction<Head, Leaf>
where\n Head: Clone + Display + Clone,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Clone,
"],["impl<Head, Leaf> Clone for GenericCommand<Head, Leaf>
where\n Head: Clone + Display + Clone,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Clone,
"],["impl<Head, Leaf> Clone for GenericNCommand<Head, Leaf>
where\n Head: Clone + Display + Clone,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Clone,
"],["impl<Head, Leaf> Clone for CorrespondingVar<Head, Leaf>
where\n Head: Clone + Display + Clone,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Clone,
"],["impl<Head, Leaf> Clone for GenericFunctionDecl<Head, Leaf>
where\n Head: Clone + Display + Clone,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Clone,
"],["impl<Head, Leaf> Clone for GenericRule<Head, Leaf>
where\n Head: Clone + Display + Clone,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Clone,
"],["impl<Head: Clone + Clone + Display, Leaf: Clone + Clone + PartialEq + Eq + Display + Hash> Clone for GenericActions<Head, Leaf>"],["impl<Head: Clone, Leaf: Clone> Clone for GenericExpr<Head, Leaf>"],["impl<Head: Clone, Leaf: Clone> Clone for GenericFact<Head, Leaf>"],["impl<Head: Clone, Leaf: Clone> Clone for GenericSchedule<Head, Leaf>"],["impl<Head: Clone, Leaf: Clone> Clone for GenericRewrite<Head, Leaf>"],["impl<Head: Clone, Leaf: Clone> Clone for GenericRunConfig<Head, Leaf>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/cmp/trait.Eq.js b/docs/trait.impl/core/cmp/trait.Eq.js new file mode 100644 index 00000000..8522c894 --- /dev/null +++ b/docs/trait.impl/core/cmp/trait.Eq.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl Eq for Change"],["impl Eq for Literal"],["impl Eq for Subdatatypes"],["impl Eq for RunMode"],["impl Eq for Term"],["impl Eq for Span"],["impl Eq for IdentSort"],["impl Eq for ResolvedVar"],["impl Eq for Schema"],["impl Eq for Variant"],["impl Eq for Primitive"],["impl Eq for TermDag"],["impl Eq for Value"],["impl Eq for SymbolGen"],["impl<Head, Leaf> Eq for GenericAction<Head, Leaf>
where\n Head: Clone + Display + Eq,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Eq,
"],["impl<Head, Leaf> Eq for GenericNCommand<Head, Leaf>
where\n Head: Clone + Display + Eq,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Eq,
"],["impl<Head, Leaf> Eq for CorrespondingVar<Head, Leaf>
where\n Head: Clone + Display + Eq,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Eq,
"],["impl<Head, Leaf> Eq for GenericFunctionDecl<Head, Leaf>
where\n Head: Clone + Display + Eq,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Eq,
"],["impl<Head, Leaf> Eq for GenericRule<Head, Leaf>
where\n Head: Clone + Display + Eq,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Eq,
"],["impl<Head: Eq + Clone + Display, Leaf: Eq + Clone + PartialEq + Eq + Display + Hash> Eq for GenericActions<Head, Leaf>"],["impl<Head: Eq, Leaf: Eq> Eq for GenericExpr<Head, Leaf>"],["impl<Head: Eq, Leaf: Eq> Eq for GenericFact<Head, Leaf>"],["impl<Head: Eq, Leaf: Eq> Eq for GenericSchedule<Head, Leaf>"],["impl<Head: Eq, Leaf: Eq> Eq for GenericRunConfig<Head, Leaf>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/cmp/trait.Ord.js b/docs/trait.impl/core/cmp/trait.Ord.js new file mode 100644 index 00000000..5a5a16b9 --- /dev/null +++ b/docs/trait.impl/core/cmp/trait.Ord.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl Ord for Literal"],["impl Ord for Value"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/cmp/trait.PartialEq.js b/docs/trait.impl/core/cmp/trait.PartialEq.js new file mode 100644 index 00000000..8a29f7bd --- /dev/null +++ b/docs/trait.impl/core/cmp/trait.PartialEq.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl PartialEq for Change"],["impl PartialEq for Literal"],["impl PartialEq for Subdatatypes"],["impl PartialEq for RunMode"],["impl PartialEq for SerializedNode"],["impl PartialEq for Term"],["impl PartialEq for Span"],["impl PartialEq for IdentSort"],["impl PartialEq for ResolvedVar"],["impl PartialEq for Schema"],["impl PartialEq for Variant"],["impl PartialEq for Primitive"],["impl PartialEq for TermDag"],["impl PartialEq for Value"],["impl PartialEq for SymbolGen"],["impl<Head, Leaf> PartialEq for GenericAction<Head, Leaf>
where\n Head: Clone + Display + PartialEq,\n Leaf: Clone + PartialEq + Eq + Display + Hash + PartialEq,
"],["impl<Head, Leaf> PartialEq for GenericNCommand<Head, Leaf>
where\n Head: Clone + Display + PartialEq,\n Leaf: Clone + PartialEq + Eq + Display + Hash + PartialEq,
"],["impl<Head, Leaf> PartialEq for CorrespondingVar<Head, Leaf>
where\n Head: Clone + Display + PartialEq,\n Leaf: Clone + PartialEq + Eq + Display + Hash + PartialEq,
"],["impl<Head, Leaf> PartialEq for GenericFunctionDecl<Head, Leaf>
where\n Head: Clone + Display + PartialEq,\n Leaf: Clone + PartialEq + Eq + Display + Hash + PartialEq,
"],["impl<Head, Leaf> PartialEq for GenericRule<Head, Leaf>
where\n Head: Clone + Display + PartialEq,\n Leaf: Clone + PartialEq + Eq + Display + Hash + PartialEq,
"],["impl<Head: PartialEq + Clone + Display, Leaf: PartialEq + Clone + PartialEq + Eq + Display + Hash> PartialEq for GenericActions<Head, Leaf>"],["impl<Head: PartialEq, Leaf: PartialEq> PartialEq for GenericExpr<Head, Leaf>"],["impl<Head: PartialEq, Leaf: PartialEq> PartialEq for GenericFact<Head, Leaf>"],["impl<Head: PartialEq, Leaf: PartialEq> PartialEq for GenericSchedule<Head, Leaf>"],["impl<Head: PartialEq, Leaf: PartialEq> PartialEq for GenericRunConfig<Head, Leaf>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/cmp/trait.PartialOrd.js b/docs/trait.impl/core/cmp/trait.PartialOrd.js new file mode 100644 index 00000000..0e8fc6da --- /dev/null +++ b/docs/trait.impl/core/cmp/trait.PartialOrd.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl PartialOrd for Literal"],["impl PartialOrd for Value"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/convert/trait.From.js b/docs/trait.impl/core/convert/trait.From.js new file mode 100644 index 00000000..8123ac66 --- /dev/null +++ b/docs/trait.impl/core/convert/trait.From.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl From<Literal> for i64"],["impl From<Literal> for Symbol"],["impl From<Literal> for OrderedFloat<f64>"],["impl From<ParseError> for Error"],["impl From<bool> for Value"],["impl From<i64> for Literal"],["impl From<i64> for Value"],["impl From<GlobalSymbol> for Literal"],["impl From<GlobalSymbol> for Value"],["impl From<NotFoundError> for Error"],["impl From<OrderedFloat<f64>> for Literal"],["impl From<OrderedFloat<f64>> for Value"],["impl<T: PrimitiveLike + 'static> From<T> for Primitive"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/default/trait.Default.js b/docs/trait.impl/core/default/trait.Default.js new file mode 100644 index 00000000..520e6293 --- /dev/null +++ b/docs/trait.impl/core/default/trait.Default.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl Default for Problem<GenericAtomTerm<Symbol>, ArcSort>"],["impl Default for EGraph"],["impl Default for RunReport"],["impl Default for SerializeConfig"],["impl Default for TermDag"],["impl Default for TypeInfo"],["impl<Head, Leaf> Default for GenericActions<Head, Leaf>
where\n Head: Clone + Display,\n Leaf: Clone + PartialEq + Eq + Display + Hash,
"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/error/trait.Error.js b/docs/trait.impl/core/error/trait.Error.js new file mode 100644 index 00000000..afd8405b --- /dev/null +++ b/docs/trait.impl/core/error/trait.Error.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl Error for ParseError"],["impl Error for Error"],["impl Error for NotFoundError"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/fmt/trait.Debug.js b/docs/trait.impl/core/fmt/trait.Debug.js new file mode 100644 index 00000000..0c01f19a --- /dev/null +++ b/docs/trait.impl/core/fmt/trait.Debug.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl Debug for Change"],["impl Debug for Literal"],["impl Debug for Subdatatypes"],["impl Debug for ParseError"],["impl Debug for ImpossibleConstraint"],["impl Debug for Error"],["impl Debug for ExtractReport"],["impl Debug for RunMode"],["impl Debug for SerializedNode"],["impl Debug for Term"],["impl Debug for Span"],["impl Debug for IdentSort"],["impl Debug for ResolvedVar"],["impl Debug for Schema"],["impl Debug for Variant"],["impl Debug for BigIntSort"],["impl Debug for BigRatSort"],["impl Debug for BoolSort"],["impl Debug for EqSort"],["impl Debug for F64Sort"],["impl Debug for FunctionSort"],["impl Debug for I64Sort"],["impl Debug for MapSort"],["impl Debug for MultiSetSort"],["impl Debug for RationalSort"],["impl Debug for SetSort"],["impl Debug for StringSort"],["impl Debug for UnitSort"],["impl Debug for VecSort"],["impl Debug for Function"],["impl Debug for NotFoundError"],["impl Debug for Primitive"],["impl Debug for RunReport"],["impl Debug for TermDag"],["impl Debug for Value"],["impl Debug for SymbolGen"],["impl<Head, Leaf> Debug for GenericAction<Head, Leaf>
where\n Head: Clone + Display + Debug,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Debug,
"],["impl<Head, Leaf> Debug for GenericCommand<Head, Leaf>
where\n Head: Clone + Display + Debug,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Debug,
"],["impl<Head, Leaf> Debug for GenericNCommand<Head, Leaf>
where\n Head: Clone + Display + Debug,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Debug,
"],["impl<Head, Leaf> Debug for CorrespondingVar<Head, Leaf>
where\n Head: Clone + Display + Debug,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Debug,
"],["impl<Head, Leaf> Debug for GenericFunctionDecl<Head, Leaf>
where\n Head: Clone + Display + Debug,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Debug,
"],["impl<Head, Leaf> Debug for GenericRule<Head, Leaf>
where\n Head: Clone + Display + Debug,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Debug,
"],["impl<Head: Debug + Clone + Display, Leaf: Debug + Clone + PartialEq + Eq + Display + Hash> Debug for GenericActions<Head, Leaf>"],["impl<Head: Debug, Leaf: Debug> Debug for GenericExpr<Head, Leaf>"],["impl<Head: Debug, Leaf: Debug> Debug for GenericFact<Head, Leaf>"],["impl<Head: Debug, Leaf: Debug> Debug for GenericSchedule<Head, Leaf>"],["impl<Head: Debug, Leaf: Debug> Debug for GenericRewrite<Head, Leaf>"],["impl<Head: Debug, Leaf: Debug> Debug for GenericRunConfig<Head, Leaf>"],["impl<Var: Debug, Value: Debug> Debug for Constraint<Var, Value>"],["impl<Var: Debug, Value: Debug> Debug for Problem<Var, Value>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/fmt/trait.Display.js b/docs/trait.impl/core/fmt/trait.Display.js new file mode 100644 index 00000000..406dbe55 --- /dev/null +++ b/docs/trait.impl/core/fmt/trait.Display.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl Display for Literal"],["impl Display for ParseError"],["impl Display for Error"],["impl Display for RunMode"],["impl Display for Span"],["impl Display for IdentSort"],["impl Display for ResolvedVar"],["impl Display for NotFoundError"],["impl Display for RunReport"],["impl<Head, Leaf> Display for GenericAction<Head, Leaf>
where\n Head: Clone + Display + ToSexp,\n Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,
"],["impl<Head, Leaf> Display for GenericCommand<Head, Leaf>
where\n Head: Clone + Display + ToSexp,\n Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,
"],["impl<Head, Leaf> Display for GenericExpr<Head, Leaf>
where\n Head: Display,\n Leaf: Display,
"],["impl<Head, Leaf> Display for GenericFact<Head, Leaf>
where\n Head: Display,\n Leaf: Display,
"],["impl<Head, Leaf> Display for GenericNCommand<Head, Leaf>
where\n Head: Clone + Display + ToSexp,\n Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,
"],["impl<Head, Leaf> Display for CorrespondingVar<Head, Leaf>
where\n Head: Clone + Display,\n Leaf: Clone + PartialEq + Eq + Display + Hash,
"],["impl<Head, Leaf> Display for GenericRule<Head, Leaf>
where\n Head: Clone + Display + ToSexp,\n Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,
"],["impl<Head: Display, Leaf: Display> Display for GenericSchedule<Head, Leaf>"],["impl<Head: Display, Leaf: Display> Display for GenericRewrite<Head, Leaf>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/hash/trait.Hash.js b/docs/trait.impl/core/hash/trait.Hash.js new file mode 100644 index 00000000..e1a8d530 --- /dev/null +++ b/docs/trait.impl/core/hash/trait.Hash.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl Hash for Change"],["impl Hash for Literal"],["impl Hash for RunMode"],["impl Hash for Term"],["impl Hash for Span"],["impl Hash for IdentSort"],["impl Hash for ResolvedVar"],["impl Hash for Schema"],["impl Hash for Variant"],["impl Hash for Primitive"],["impl Hash for Value"],["impl<Head, Leaf> Hash for GenericAction<Head, Leaf>
where\n Head: Clone + Display + Hash,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Hash,
"],["impl<Head, Leaf> Hash for GenericNCommand<Head, Leaf>
where\n Head: Clone + Display + Hash,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Hash,
"],["impl<Head, Leaf> Hash for CorrespondingVar<Head, Leaf>
where\n Head: Clone + Display + Hash,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Hash,
"],["impl<Head, Leaf> Hash for GenericFunctionDecl<Head, Leaf>
where\n Head: Clone + Display + Hash,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Hash,
"],["impl<Head, Leaf> Hash for GenericRule<Head, Leaf>
where\n Head: Clone + Display + Hash,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Hash,
"],["impl<Head: Hash + Clone + Display, Leaf: Hash + Clone + PartialEq + Eq + Display + Hash> Hash for GenericActions<Head, Leaf>"],["impl<Head: Hash, Leaf: Hash> Hash for GenericExpr<Head, Leaf>"],["impl<Head: Hash, Leaf: Hash> Hash for GenericFact<Head, Leaf>"],["impl<Head: Hash, Leaf: Hash> Hash for GenericSchedule<Head, Leaf>"],["impl<Head: Hash, Leaf: Hash> Hash for GenericRunConfig<Head, Leaf>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/marker/trait.Copy.js b/docs/trait.impl/core/marker/trait.Copy.js new file mode 100644 index 00000000..477b0df3 --- /dev/null +++ b/docs/trait.impl/core/marker/trait.Copy.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl Copy for Change"],["impl Copy for RunMode"],["impl Copy for Value"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/marker/trait.Freeze.js b/docs/trait.impl/core/marker/trait.Freeze.js new file mode 100644 index 00000000..2217e03a --- /dev/null +++ b/docs/trait.impl/core/marker/trait.Freeze.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl !Freeze for FunctionSort",1,["egglog::sort::fn::FunctionSort"]],["impl !Freeze for MapSort",1,["egglog::sort::map::MapSort"]],["impl !Freeze for MultiSetSort",1,["egglog::sort::multiset::MultiSetSort"]],["impl !Freeze for SetSort",1,["egglog::sort::set::SetSort"]],["impl !Freeze for VecSort",1,["egglog::sort::vec::VecSort"]],["impl Freeze for Change",1,["egglog::ast::Change"]],["impl Freeze for Literal",1,["egglog::ast::expr::Literal"]],["impl Freeze for Subdatatypes",1,["egglog::ast::Subdatatypes"]],["impl Freeze for ParseError",1,["egglog::ast::parse::ParseError"]],["impl Freeze for ImpossibleConstraint",1,["egglog::constraint::ImpossibleConstraint"]],["impl Freeze for Error",1,["egglog::Error"]],["impl Freeze for ExtractReport",1,["egglog::ExtractReport"]],["impl Freeze for RunMode",1,["egglog::RunMode"]],["impl Freeze for SerializedNode",1,["egglog::serialize::SerializedNode"]],["impl Freeze for Term",1,["egglog::termdag::Term"]],["impl Freeze for DUMMY_SPAN",1,["egglog::ast::parse::DUMMY_SPAN"]],["impl Freeze for Span",1,["egglog::ast::parse::Span"]],["impl Freeze for IdentSort",1,["egglog::ast::IdentSort"]],["impl Freeze for ResolvedVar",1,["egglog::ast::expr::ResolvedVar"]],["impl Freeze for Schema",1,["egglog::ast::Schema"]],["impl Freeze for Variant",1,["egglog::ast::Variant"]],["impl Freeze for AllEqualTypeConstraint",1,["egglog::constraint::AllEqualTypeConstraint"]],["impl Freeze for SimpleTypeConstraint",1,["egglog::constraint::SimpleTypeConstraint"]],["impl Freeze for BigIntSort",1,["egglog::sort::bigint::BigIntSort"]],["impl Freeze for BigRatSort",1,["egglog::sort::bigrat::BigRatSort"]],["impl Freeze for BoolSort",1,["egglog::sort::bool::BoolSort"]],["impl Freeze for EqSort",1,["egglog::sort::EqSort"]],["impl Freeze for F64Sort",1,["egglog::sort::f64::F64Sort"]],["impl Freeze for I64Sort",1,["egglog::sort::i64::I64Sort"]],["impl Freeze for NotEqualPrimitive",1,["egglog::sort::unit::NotEqualPrimitive"]],["impl Freeze for RationalSort",1,["egglog::sort::rational::RationalSort"]],["impl Freeze for StringSort",1,["egglog::sort::string::StringSort"]],["impl Freeze for UnitSort",1,["egglog::sort::unit::UnitSort"]],["impl Freeze for EGraph",1,["egglog::EGraph"]],["impl Freeze for Function",1,["egglog::function::Function"]],["impl Freeze for NotFoundError",1,["egglog::NotFoundError"]],["impl Freeze for Primitive",1,["egglog::Primitive"]],["impl Freeze for RunReport",1,["egglog::RunReport"]],["impl Freeze for SerializeConfig",1,["egglog::serialize::SerializeConfig"]],["impl Freeze for SimplePrimitive",1,["egglog::SimplePrimitive"]],["impl Freeze for TermDag",1,["egglog::termdag::TermDag"]],["impl Freeze for TypeInfo",1,["egglog::typechecking::TypeInfo"]],["impl Freeze for Value",1,["egglog::value::Value"]],["impl Freeze for SymbolGen",1,["egglog::util::SymbolGen"]],["impl<Head, Leaf> Freeze for GenericAction<Head, Leaf>
where\n Leaf: Freeze,\n Head: Freeze,
",1,["egglog::ast::GenericAction"]],["impl<Head, Leaf> Freeze for GenericCommand<Head, Leaf>
where\n Leaf: Freeze,\n Head: Freeze,
",1,["egglog::ast::GenericCommand"]],["impl<Head, Leaf> Freeze for GenericExpr<Head, Leaf>
where\n Leaf: Freeze,\n Head: Freeze,
",1,["egglog::ast::expr::GenericExpr"]],["impl<Head, Leaf> Freeze for GenericFact<Head, Leaf>
where\n Leaf: Freeze,\n Head: Freeze,
",1,["egglog::ast::GenericFact"]],["impl<Head, Leaf> Freeze for GenericNCommand<Head, Leaf>
where\n Leaf: Freeze,\n Head: Freeze,
",1,["egglog::ast::GenericNCommand"]],["impl<Head, Leaf> Freeze for GenericSchedule<Head, Leaf>",1,["egglog::ast::GenericSchedule"]],["impl<Head, Leaf> Freeze for CorrespondingVar<Head, Leaf>
where\n Head: Freeze,\n Leaf: Freeze,
",1,["egglog::ast::CorrespondingVar"]],["impl<Head, Leaf> Freeze for Facts<Head, Leaf>",1,["egglog::ast::Facts"]],["impl<Head, Leaf> Freeze for GenericActions<Head, Leaf>",1,["egglog::ast::GenericActions"]],["impl<Head, Leaf> Freeze for GenericFunctionDecl<Head, Leaf>
where\n Leaf: Freeze,\n Head: Freeze,
",1,["egglog::ast::GenericFunctionDecl"]],["impl<Head, Leaf> Freeze for GenericRewrite<Head, Leaf>
where\n Leaf: Freeze,\n Head: Freeze,
",1,["egglog::ast::GenericRewrite"]],["impl<Head, Leaf> Freeze for GenericRule<Head, Leaf>",1,["egglog::ast::GenericRule"]],["impl<Head, Leaf> Freeze for GenericRunConfig<Head, Leaf>",1,["egglog::ast::GenericRunConfig"]],["impl<Var, Value> Freeze for Constraint<Var, Value>
where\n Var: Freeze,\n Value: Freeze,
",1,["egglog::constraint::Constraint"]],["impl<Var, Value> Freeze for ConstraintError<Var, Value>
where\n Var: Freeze,\n Value: Freeze,
",1,["egglog::constraint::ConstraintError"]],["impl<Var, Value> Freeze for Problem<Var, Value>",1,["egglog::constraint::Problem"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/marker/trait.Send.js b/docs/trait.impl/core/marker/trait.Send.js new file mode 100644 index 00000000..18ae5b34 --- /dev/null +++ b/docs/trait.impl/core/marker/trait.Send.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl !Send for Error",1,["egglog::Error"]],["impl !Send for EGraph",1,["egglog::EGraph"]],["impl !Send for Function",1,["egglog::function::Function"]],["impl !Send for Primitive",1,["egglog::Primitive"]],["impl !Send for TypeInfo",1,["egglog::typechecking::TypeInfo"]],["impl Send for Change",1,["egglog::ast::Change"]],["impl Send for Literal",1,["egglog::ast::expr::Literal"]],["impl Send for Subdatatypes",1,["egglog::ast::Subdatatypes"]],["impl Send for ParseError",1,["egglog::ast::parse::ParseError"]],["impl Send for ImpossibleConstraint",1,["egglog::constraint::ImpossibleConstraint"]],["impl Send for ExtractReport",1,["egglog::ExtractReport"]],["impl Send for RunMode",1,["egglog::RunMode"]],["impl Send for SerializedNode",1,["egglog::serialize::SerializedNode"]],["impl Send for Term",1,["egglog::termdag::Term"]],["impl Send for DUMMY_SPAN",1,["egglog::ast::parse::DUMMY_SPAN"]],["impl Send for Span",1,["egglog::ast::parse::Span"]],["impl Send for IdentSort",1,["egglog::ast::IdentSort"]],["impl Send for ResolvedVar",1,["egglog::ast::expr::ResolvedVar"]],["impl Send for Schema",1,["egglog::ast::Schema"]],["impl Send for Variant",1,["egglog::ast::Variant"]],["impl Send for AllEqualTypeConstraint",1,["egglog::constraint::AllEqualTypeConstraint"]],["impl Send for SimpleTypeConstraint",1,["egglog::constraint::SimpleTypeConstraint"]],["impl Send for BigIntSort",1,["egglog::sort::bigint::BigIntSort"]],["impl Send for BigRatSort",1,["egglog::sort::bigrat::BigRatSort"]],["impl Send for BoolSort",1,["egglog::sort::bool::BoolSort"]],["impl Send for EqSort",1,["egglog::sort::EqSort"]],["impl Send for F64Sort",1,["egglog::sort::f64::F64Sort"]],["impl Send for FunctionSort",1,["egglog::sort::fn::FunctionSort"]],["impl Send for I64Sort",1,["egglog::sort::i64::I64Sort"]],["impl Send for MapSort",1,["egglog::sort::map::MapSort"]],["impl Send for MultiSetSort",1,["egglog::sort::multiset::MultiSetSort"]],["impl Send for NotEqualPrimitive",1,["egglog::sort::unit::NotEqualPrimitive"]],["impl Send for RationalSort",1,["egglog::sort::rational::RationalSort"]],["impl Send for SetSort",1,["egglog::sort::set::SetSort"]],["impl Send for StringSort",1,["egglog::sort::string::StringSort"]],["impl Send for UnitSort",1,["egglog::sort::unit::UnitSort"]],["impl Send for VecSort",1,["egglog::sort::vec::VecSort"]],["impl Send for NotFoundError",1,["egglog::NotFoundError"]],["impl Send for RunReport",1,["egglog::RunReport"]],["impl Send for SerializeConfig",1,["egglog::serialize::SerializeConfig"]],["impl Send for SimplePrimitive",1,["egglog::SimplePrimitive"]],["impl Send for TermDag",1,["egglog::termdag::TermDag"]],["impl Send for Value",1,["egglog::value::Value"]],["impl Send for SymbolGen",1,["egglog::util::SymbolGen"]],["impl<Head, Leaf> Send for GenericAction<Head, Leaf>
where\n Leaf: Send,\n Head: Send,
",1,["egglog::ast::GenericAction"]],["impl<Head, Leaf> Send for GenericCommand<Head, Leaf>
where\n Leaf: Send,\n Head: Send,
",1,["egglog::ast::GenericCommand"]],["impl<Head, Leaf> Send for GenericExpr<Head, Leaf>
where\n Leaf: Send,\n Head: Send,
",1,["egglog::ast::expr::GenericExpr"]],["impl<Head, Leaf> Send for GenericFact<Head, Leaf>
where\n Leaf: Send,\n Head: Send,
",1,["egglog::ast::GenericFact"]],["impl<Head, Leaf> Send for GenericNCommand<Head, Leaf>
where\n Leaf: Send,\n Head: Send,
",1,["egglog::ast::GenericNCommand"]],["impl<Head, Leaf> Send for GenericSchedule<Head, Leaf>
where\n Leaf: Send,\n Head: Send,
",1,["egglog::ast::GenericSchedule"]],["impl<Head, Leaf> Send for CorrespondingVar<Head, Leaf>
where\n Head: Send,\n Leaf: Send,
",1,["egglog::ast::CorrespondingVar"]],["impl<Head, Leaf> Send for Facts<Head, Leaf>
where\n Leaf: Send,\n Head: Send,
",1,["egglog::ast::Facts"]],["impl<Head, Leaf> Send for GenericActions<Head, Leaf>
where\n Leaf: Send,\n Head: Send,
",1,["egglog::ast::GenericActions"]],["impl<Head, Leaf> Send for GenericFunctionDecl<Head, Leaf>
where\n Leaf: Send,\n Head: Send,
",1,["egglog::ast::GenericFunctionDecl"]],["impl<Head, Leaf> Send for GenericRewrite<Head, Leaf>
where\n Leaf: Send,\n Head: Send,
",1,["egglog::ast::GenericRewrite"]],["impl<Head, Leaf> Send for GenericRule<Head, Leaf>
where\n Leaf: Send,\n Head: Send,
",1,["egglog::ast::GenericRule"]],["impl<Head, Leaf> Send for GenericRunConfig<Head, Leaf>
where\n Leaf: Send,\n Head: Send,
",1,["egglog::ast::GenericRunConfig"]],["impl<Var, Value> Send for Constraint<Var, Value>
where\n Var: Send,\n Value: Send,
",1,["egglog::constraint::Constraint"]],["impl<Var, Value> Send for ConstraintError<Var, Value>
where\n Var: Send,\n Value: Send,
",1,["egglog::constraint::ConstraintError"]],["impl<Var, Value> Send for Problem<Var, Value>
where\n Var: Send,\n Value: Send,
",1,["egglog::constraint::Problem"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/marker/trait.StructuralPartialEq.js b/docs/trait.impl/core/marker/trait.StructuralPartialEq.js new file mode 100644 index 00000000..7ebb100b --- /dev/null +++ b/docs/trait.impl/core/marker/trait.StructuralPartialEq.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl StructuralPartialEq for Change"],["impl StructuralPartialEq for Literal"],["impl StructuralPartialEq for Subdatatypes"],["impl StructuralPartialEq for RunMode"],["impl StructuralPartialEq for SerializedNode"],["impl StructuralPartialEq for Term"],["impl StructuralPartialEq for Span"],["impl StructuralPartialEq for IdentSort"],["impl StructuralPartialEq for Schema"],["impl StructuralPartialEq for Variant"],["impl StructuralPartialEq for TermDag"],["impl StructuralPartialEq for Value"],["impl StructuralPartialEq for SymbolGen"],["impl<Head, Leaf> StructuralPartialEq for GenericAction<Head, Leaf>
where\n Head: Clone + Display,\n Leaf: Clone + PartialEq + Eq + Display + Hash,
"],["impl<Head, Leaf> StructuralPartialEq for GenericExpr<Head, Leaf>"],["impl<Head, Leaf> StructuralPartialEq for GenericFact<Head, Leaf>"],["impl<Head, Leaf> StructuralPartialEq for GenericNCommand<Head, Leaf>
where\n Head: Clone + Display,\n Leaf: Clone + PartialEq + Eq + Display + Hash,
"],["impl<Head, Leaf> StructuralPartialEq for GenericSchedule<Head, Leaf>"],["impl<Head, Leaf> StructuralPartialEq for CorrespondingVar<Head, Leaf>
where\n Head: Clone + Display,\n Leaf: Clone + PartialEq + Eq + Display + Hash,
"],["impl<Head, Leaf> StructuralPartialEq for GenericFunctionDecl<Head, Leaf>
where\n Head: Clone + Display,\n Leaf: Clone + PartialEq + Eq + Display + Hash,
"],["impl<Head, Leaf> StructuralPartialEq for GenericRule<Head, Leaf>
where\n Head: Clone + Display,\n Leaf: Clone + PartialEq + Eq + Display + Hash,
"],["impl<Head, Leaf> StructuralPartialEq for GenericRunConfig<Head, Leaf>"],["impl<Head: Clone + Display, Leaf: Clone + PartialEq + Eq + Display + Hash> StructuralPartialEq for GenericActions<Head, Leaf>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/marker/trait.Sync.js b/docs/trait.impl/core/marker/trait.Sync.js new file mode 100644 index 00000000..eb98869b --- /dev/null +++ b/docs/trait.impl/core/marker/trait.Sync.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl !Sync for Error",1,["egglog::Error"]],["impl !Sync for EGraph",1,["egglog::EGraph"]],["impl !Sync for Function",1,["egglog::function::Function"]],["impl !Sync for Primitive",1,["egglog::Primitive"]],["impl !Sync for TypeInfo",1,["egglog::typechecking::TypeInfo"]],["impl Sync for Change",1,["egglog::ast::Change"]],["impl Sync for Literal",1,["egglog::ast::expr::Literal"]],["impl Sync for Subdatatypes",1,["egglog::ast::Subdatatypes"]],["impl Sync for ParseError",1,["egglog::ast::parse::ParseError"]],["impl Sync for ImpossibleConstraint",1,["egglog::constraint::ImpossibleConstraint"]],["impl Sync for ExtractReport",1,["egglog::ExtractReport"]],["impl Sync for RunMode",1,["egglog::RunMode"]],["impl Sync for SerializedNode",1,["egglog::serialize::SerializedNode"]],["impl Sync for Term",1,["egglog::termdag::Term"]],["impl Sync for DUMMY_SPAN",1,["egglog::ast::parse::DUMMY_SPAN"]],["impl Sync for Span",1,["egglog::ast::parse::Span"]],["impl Sync for IdentSort",1,["egglog::ast::IdentSort"]],["impl Sync for ResolvedVar",1,["egglog::ast::expr::ResolvedVar"]],["impl Sync for Schema",1,["egglog::ast::Schema"]],["impl Sync for Variant",1,["egglog::ast::Variant"]],["impl Sync for AllEqualTypeConstraint",1,["egglog::constraint::AllEqualTypeConstraint"]],["impl Sync for SimpleTypeConstraint",1,["egglog::constraint::SimpleTypeConstraint"]],["impl Sync for BigIntSort",1,["egglog::sort::bigint::BigIntSort"]],["impl Sync for BigRatSort",1,["egglog::sort::bigrat::BigRatSort"]],["impl Sync for BoolSort",1,["egglog::sort::bool::BoolSort"]],["impl Sync for EqSort",1,["egglog::sort::EqSort"]],["impl Sync for F64Sort",1,["egglog::sort::f64::F64Sort"]],["impl Sync for FunctionSort",1,["egglog::sort::fn::FunctionSort"]],["impl Sync for I64Sort",1,["egglog::sort::i64::I64Sort"]],["impl Sync for MapSort",1,["egglog::sort::map::MapSort"]],["impl Sync for MultiSetSort",1,["egglog::sort::multiset::MultiSetSort"]],["impl Sync for NotEqualPrimitive",1,["egglog::sort::unit::NotEqualPrimitive"]],["impl Sync for RationalSort",1,["egglog::sort::rational::RationalSort"]],["impl Sync for SetSort",1,["egglog::sort::set::SetSort"]],["impl Sync for StringSort",1,["egglog::sort::string::StringSort"]],["impl Sync for UnitSort",1,["egglog::sort::unit::UnitSort"]],["impl Sync for VecSort",1,["egglog::sort::vec::VecSort"]],["impl Sync for NotFoundError",1,["egglog::NotFoundError"]],["impl Sync for RunReport",1,["egglog::RunReport"]],["impl Sync for SerializeConfig",1,["egglog::serialize::SerializeConfig"]],["impl Sync for SimplePrimitive",1,["egglog::SimplePrimitive"]],["impl Sync for TermDag",1,["egglog::termdag::TermDag"]],["impl Sync for Value",1,["egglog::value::Value"]],["impl Sync for SymbolGen",1,["egglog::util::SymbolGen"]],["impl<Head, Leaf> Sync for GenericAction<Head, Leaf>
where\n Leaf: Sync,\n Head: Sync,
",1,["egglog::ast::GenericAction"]],["impl<Head, Leaf> Sync for GenericCommand<Head, Leaf>
where\n Leaf: Sync,\n Head: Sync,
",1,["egglog::ast::GenericCommand"]],["impl<Head, Leaf> Sync for GenericExpr<Head, Leaf>
where\n Leaf: Sync,\n Head: Sync,
",1,["egglog::ast::expr::GenericExpr"]],["impl<Head, Leaf> Sync for GenericFact<Head, Leaf>
where\n Leaf: Sync,\n Head: Sync,
",1,["egglog::ast::GenericFact"]],["impl<Head, Leaf> Sync for GenericNCommand<Head, Leaf>
where\n Leaf: Sync,\n Head: Sync,
",1,["egglog::ast::GenericNCommand"]],["impl<Head, Leaf> Sync for GenericSchedule<Head, Leaf>
where\n Leaf: Sync,\n Head: Sync,
",1,["egglog::ast::GenericSchedule"]],["impl<Head, Leaf> Sync for CorrespondingVar<Head, Leaf>
where\n Head: Sync,\n Leaf: Sync,
",1,["egglog::ast::CorrespondingVar"]],["impl<Head, Leaf> Sync for Facts<Head, Leaf>
where\n Leaf: Sync,\n Head: Sync,
",1,["egglog::ast::Facts"]],["impl<Head, Leaf> Sync for GenericActions<Head, Leaf>
where\n Leaf: Sync,\n Head: Sync,
",1,["egglog::ast::GenericActions"]],["impl<Head, Leaf> Sync for GenericFunctionDecl<Head, Leaf>
where\n Leaf: Sync,\n Head: Sync,
",1,["egglog::ast::GenericFunctionDecl"]],["impl<Head, Leaf> Sync for GenericRewrite<Head, Leaf>
where\n Leaf: Sync,\n Head: Sync,
",1,["egglog::ast::GenericRewrite"]],["impl<Head, Leaf> Sync for GenericRule<Head, Leaf>
where\n Leaf: Sync,\n Head: Sync,
",1,["egglog::ast::GenericRule"]],["impl<Head, Leaf> Sync for GenericRunConfig<Head, Leaf>
where\n Leaf: Sync,\n Head: Sync,
",1,["egglog::ast::GenericRunConfig"]],["impl<Var, Value> Sync for Constraint<Var, Value>
where\n Var: Sync,\n Value: Sync,
",1,["egglog::constraint::Constraint"]],["impl<Var, Value> Sync for ConstraintError<Var, Value>
where\n Var: Sync,\n Value: Sync,
",1,["egglog::constraint::ConstraintError"]],["impl<Var, Value> Sync for Problem<Var, Value>
where\n Var: Sync,\n Value: Sync,
",1,["egglog::constraint::Problem"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/marker/trait.Unpin.js b/docs/trait.impl/core/marker/trait.Unpin.js new file mode 100644 index 00000000..5b1e6e4f --- /dev/null +++ b/docs/trait.impl/core/marker/trait.Unpin.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl Unpin for Change",1,["egglog::ast::Change"]],["impl Unpin for Literal",1,["egglog::ast::expr::Literal"]],["impl Unpin for Subdatatypes",1,["egglog::ast::Subdatatypes"]],["impl Unpin for ParseError",1,["egglog::ast::parse::ParseError"]],["impl Unpin for ImpossibleConstraint",1,["egglog::constraint::ImpossibleConstraint"]],["impl Unpin for Error",1,["egglog::Error"]],["impl Unpin for ExtractReport",1,["egglog::ExtractReport"]],["impl Unpin for RunMode",1,["egglog::RunMode"]],["impl Unpin for SerializedNode",1,["egglog::serialize::SerializedNode"]],["impl Unpin for Term",1,["egglog::termdag::Term"]],["impl Unpin for DUMMY_SPAN",1,["egglog::ast::parse::DUMMY_SPAN"]],["impl Unpin for Span",1,["egglog::ast::parse::Span"]],["impl Unpin for IdentSort",1,["egglog::ast::IdentSort"]],["impl Unpin for ResolvedVar",1,["egglog::ast::expr::ResolvedVar"]],["impl Unpin for Schema",1,["egglog::ast::Schema"]],["impl Unpin for Variant",1,["egglog::ast::Variant"]],["impl Unpin for AllEqualTypeConstraint",1,["egglog::constraint::AllEqualTypeConstraint"]],["impl Unpin for SimpleTypeConstraint",1,["egglog::constraint::SimpleTypeConstraint"]],["impl Unpin for BigIntSort",1,["egglog::sort::bigint::BigIntSort"]],["impl Unpin for BigRatSort",1,["egglog::sort::bigrat::BigRatSort"]],["impl Unpin for BoolSort",1,["egglog::sort::bool::BoolSort"]],["impl Unpin for EqSort",1,["egglog::sort::EqSort"]],["impl Unpin for F64Sort",1,["egglog::sort::f64::F64Sort"]],["impl Unpin for FunctionSort",1,["egglog::sort::fn::FunctionSort"]],["impl Unpin for I64Sort",1,["egglog::sort::i64::I64Sort"]],["impl Unpin for MapSort",1,["egglog::sort::map::MapSort"]],["impl Unpin for MultiSetSort",1,["egglog::sort::multiset::MultiSetSort"]],["impl Unpin for NotEqualPrimitive",1,["egglog::sort::unit::NotEqualPrimitive"]],["impl Unpin for RationalSort",1,["egglog::sort::rational::RationalSort"]],["impl Unpin for SetSort",1,["egglog::sort::set::SetSort"]],["impl Unpin for StringSort",1,["egglog::sort::string::StringSort"]],["impl Unpin for UnitSort",1,["egglog::sort::unit::UnitSort"]],["impl Unpin for VecSort",1,["egglog::sort::vec::VecSort"]],["impl Unpin for EGraph",1,["egglog::EGraph"]],["impl Unpin for Function",1,["egglog::function::Function"]],["impl Unpin for NotFoundError",1,["egglog::NotFoundError"]],["impl Unpin for Primitive",1,["egglog::Primitive"]],["impl Unpin for RunReport",1,["egglog::RunReport"]],["impl Unpin for SerializeConfig",1,["egglog::serialize::SerializeConfig"]],["impl Unpin for SimplePrimitive",1,["egglog::SimplePrimitive"]],["impl Unpin for TermDag",1,["egglog::termdag::TermDag"]],["impl Unpin for TypeInfo",1,["egglog::typechecking::TypeInfo"]],["impl Unpin for Value",1,["egglog::value::Value"]],["impl Unpin for SymbolGen",1,["egglog::util::SymbolGen"]],["impl<Head, Leaf> Unpin for GenericAction<Head, Leaf>
where\n Leaf: Unpin,\n Head: Unpin,
",1,["egglog::ast::GenericAction"]],["impl<Head, Leaf> Unpin for GenericCommand<Head, Leaf>
where\n Leaf: Unpin,\n Head: Unpin,
",1,["egglog::ast::GenericCommand"]],["impl<Head, Leaf> Unpin for GenericExpr<Head, Leaf>
where\n Leaf: Unpin,\n Head: Unpin,
",1,["egglog::ast::expr::GenericExpr"]],["impl<Head, Leaf> Unpin for GenericFact<Head, Leaf>
where\n Leaf: Unpin,\n Head: Unpin,
",1,["egglog::ast::GenericFact"]],["impl<Head, Leaf> Unpin for GenericNCommand<Head, Leaf>
where\n Leaf: Unpin,\n Head: Unpin,
",1,["egglog::ast::GenericNCommand"]],["impl<Head, Leaf> Unpin for GenericSchedule<Head, Leaf>
where\n Leaf: Unpin,\n Head: Unpin,
",1,["egglog::ast::GenericSchedule"]],["impl<Head, Leaf> Unpin for CorrespondingVar<Head, Leaf>
where\n Head: Unpin,\n Leaf: Unpin,
",1,["egglog::ast::CorrespondingVar"]],["impl<Head, Leaf> Unpin for Facts<Head, Leaf>
where\n Leaf: Unpin,\n Head: Unpin,
",1,["egglog::ast::Facts"]],["impl<Head, Leaf> Unpin for GenericActions<Head, Leaf>
where\n Leaf: Unpin,\n Head: Unpin,
",1,["egglog::ast::GenericActions"]],["impl<Head, Leaf> Unpin for GenericFunctionDecl<Head, Leaf>
where\n Leaf: Unpin,\n Head: Unpin,
",1,["egglog::ast::GenericFunctionDecl"]],["impl<Head, Leaf> Unpin for GenericRewrite<Head, Leaf>
where\n Leaf: Unpin,\n Head: Unpin,
",1,["egglog::ast::GenericRewrite"]],["impl<Head, Leaf> Unpin for GenericRule<Head, Leaf>
where\n Leaf: Unpin,\n Head: Unpin,
",1,["egglog::ast::GenericRule"]],["impl<Head, Leaf> Unpin for GenericRunConfig<Head, Leaf>
where\n Leaf: Unpin,\n Head: Unpin,
",1,["egglog::ast::GenericRunConfig"]],["impl<Var, Value> Unpin for Constraint<Var, Value>
where\n Var: Unpin,\n Value: Unpin,
",1,["egglog::constraint::Constraint"]],["impl<Var, Value> Unpin for ConstraintError<Var, Value>
where\n Var: Unpin,\n Value: Unpin,
",1,["egglog::constraint::ConstraintError"]],["impl<Var, Value> Unpin for Problem<Var, Value>
where\n Var: Unpin,\n Value: Unpin,
",1,["egglog::constraint::Problem"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/ops/deref/trait.Deref.js b/docs/trait.impl/core/ops/deref/trait.Deref.js new file mode 100644 index 00000000..bc3df402 --- /dev/null +++ b/docs/trait.impl/core/ops/deref/trait.Deref.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl Deref for DUMMY_SPAN"],["impl Deref for Primitive"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js b/docs/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js new file mode 100644 index 00000000..03b3bfc8 --- /dev/null +++ b/docs/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl !RefUnwindSafe for ImpossibleConstraint",1,["egglog::constraint::ImpossibleConstraint"]],["impl !RefUnwindSafe for Error",1,["egglog::Error"]],["impl !RefUnwindSafe for ResolvedVar",1,["egglog::ast::expr::ResolvedVar"]],["impl !RefUnwindSafe for AllEqualTypeConstraint",1,["egglog::constraint::AllEqualTypeConstraint"]],["impl !RefUnwindSafe for SimpleTypeConstraint",1,["egglog::constraint::SimpleTypeConstraint"]],["impl !RefUnwindSafe for FunctionSort",1,["egglog::sort::fn::FunctionSort"]],["impl !RefUnwindSafe for MapSort",1,["egglog::sort::map::MapSort"]],["impl !RefUnwindSafe for MultiSetSort",1,["egglog::sort::multiset::MultiSetSort"]],["impl !RefUnwindSafe for NotEqualPrimitive",1,["egglog::sort::unit::NotEqualPrimitive"]],["impl !RefUnwindSafe for SetSort",1,["egglog::sort::set::SetSort"]],["impl !RefUnwindSafe for VecSort",1,["egglog::sort::vec::VecSort"]],["impl !RefUnwindSafe for EGraph",1,["egglog::EGraph"]],["impl !RefUnwindSafe for Function",1,["egglog::function::Function"]],["impl !RefUnwindSafe for Primitive",1,["egglog::Primitive"]],["impl !RefUnwindSafe for SerializeConfig",1,["egglog::serialize::SerializeConfig"]],["impl !RefUnwindSafe for SimplePrimitive",1,["egglog::SimplePrimitive"]],["impl !RefUnwindSafe for TypeInfo",1,["egglog::typechecking::TypeInfo"]],["impl RefUnwindSafe for Change",1,["egglog::ast::Change"]],["impl RefUnwindSafe for Literal",1,["egglog::ast::expr::Literal"]],["impl RefUnwindSafe for Subdatatypes",1,["egglog::ast::Subdatatypes"]],["impl RefUnwindSafe for ParseError",1,["egglog::ast::parse::ParseError"]],["impl RefUnwindSafe for ExtractReport",1,["egglog::ExtractReport"]],["impl RefUnwindSafe for RunMode",1,["egglog::RunMode"]],["impl RefUnwindSafe for SerializedNode",1,["egglog::serialize::SerializedNode"]],["impl RefUnwindSafe for Term",1,["egglog::termdag::Term"]],["impl RefUnwindSafe for DUMMY_SPAN",1,["egglog::ast::parse::DUMMY_SPAN"]],["impl RefUnwindSafe for Span",1,["egglog::ast::parse::Span"]],["impl RefUnwindSafe for IdentSort",1,["egglog::ast::IdentSort"]],["impl RefUnwindSafe for Schema",1,["egglog::ast::Schema"]],["impl RefUnwindSafe for Variant",1,["egglog::ast::Variant"]],["impl RefUnwindSafe for BigIntSort",1,["egglog::sort::bigint::BigIntSort"]],["impl RefUnwindSafe for BigRatSort",1,["egglog::sort::bigrat::BigRatSort"]],["impl RefUnwindSafe for BoolSort",1,["egglog::sort::bool::BoolSort"]],["impl RefUnwindSafe for EqSort",1,["egglog::sort::EqSort"]],["impl RefUnwindSafe for F64Sort",1,["egglog::sort::f64::F64Sort"]],["impl RefUnwindSafe for I64Sort",1,["egglog::sort::i64::I64Sort"]],["impl RefUnwindSafe for RationalSort",1,["egglog::sort::rational::RationalSort"]],["impl RefUnwindSafe for StringSort",1,["egglog::sort::string::StringSort"]],["impl RefUnwindSafe for UnitSort",1,["egglog::sort::unit::UnitSort"]],["impl RefUnwindSafe for NotFoundError",1,["egglog::NotFoundError"]],["impl RefUnwindSafe for RunReport",1,["egglog::RunReport"]],["impl RefUnwindSafe for TermDag",1,["egglog::termdag::TermDag"]],["impl RefUnwindSafe for Value",1,["egglog::value::Value"]],["impl RefUnwindSafe for SymbolGen",1,["egglog::util::SymbolGen"]],["impl<Head, Leaf> RefUnwindSafe for GenericAction<Head, Leaf>
where\n Leaf: RefUnwindSafe,\n Head: RefUnwindSafe,
",1,["egglog::ast::GenericAction"]],["impl<Head, Leaf> RefUnwindSafe for GenericCommand<Head, Leaf>
where\n Leaf: RefUnwindSafe,\n Head: RefUnwindSafe,
",1,["egglog::ast::GenericCommand"]],["impl<Head, Leaf> RefUnwindSafe for GenericExpr<Head, Leaf>
where\n Leaf: RefUnwindSafe,\n Head: RefUnwindSafe,
",1,["egglog::ast::expr::GenericExpr"]],["impl<Head, Leaf> RefUnwindSafe for GenericFact<Head, Leaf>
where\n Leaf: RefUnwindSafe,\n Head: RefUnwindSafe,
",1,["egglog::ast::GenericFact"]],["impl<Head, Leaf> RefUnwindSafe for GenericNCommand<Head, Leaf>
where\n Leaf: RefUnwindSafe,\n Head: RefUnwindSafe,
",1,["egglog::ast::GenericNCommand"]],["impl<Head, Leaf> RefUnwindSafe for GenericSchedule<Head, Leaf>
where\n Leaf: RefUnwindSafe,\n Head: RefUnwindSafe,
",1,["egglog::ast::GenericSchedule"]],["impl<Head, Leaf> RefUnwindSafe for CorrespondingVar<Head, Leaf>
where\n Head: RefUnwindSafe,\n Leaf: RefUnwindSafe,
",1,["egglog::ast::CorrespondingVar"]],["impl<Head, Leaf> RefUnwindSafe for Facts<Head, Leaf>
where\n Leaf: RefUnwindSafe,\n Head: RefUnwindSafe,
",1,["egglog::ast::Facts"]],["impl<Head, Leaf> RefUnwindSafe for GenericActions<Head, Leaf>
where\n Leaf: RefUnwindSafe,\n Head: RefUnwindSafe,
",1,["egglog::ast::GenericActions"]],["impl<Head, Leaf> RefUnwindSafe for GenericFunctionDecl<Head, Leaf>
where\n Leaf: RefUnwindSafe,\n Head: RefUnwindSafe,
",1,["egglog::ast::GenericFunctionDecl"]],["impl<Head, Leaf> RefUnwindSafe for GenericRewrite<Head, Leaf>
where\n Leaf: RefUnwindSafe,\n Head: RefUnwindSafe,
",1,["egglog::ast::GenericRewrite"]],["impl<Head, Leaf> RefUnwindSafe for GenericRule<Head, Leaf>
where\n Leaf: RefUnwindSafe,\n Head: RefUnwindSafe,
",1,["egglog::ast::GenericRule"]],["impl<Head, Leaf> RefUnwindSafe for GenericRunConfig<Head, Leaf>
where\n Leaf: RefUnwindSafe,\n Head: RefUnwindSafe,
",1,["egglog::ast::GenericRunConfig"]],["impl<Var, Value> !RefUnwindSafe for Constraint<Var, Value>",1,["egglog::constraint::Constraint"]],["impl<Var, Value> !RefUnwindSafe for ConstraintError<Var, Value>",1,["egglog::constraint::ConstraintError"]],["impl<Var, Value> !RefUnwindSafe for Problem<Var, Value>",1,["egglog::constraint::Problem"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js b/docs/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js new file mode 100644 index 00000000..c73c6531 --- /dev/null +++ b/docs/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl !UnwindSafe for ImpossibleConstraint",1,["egglog::constraint::ImpossibleConstraint"]],["impl !UnwindSafe for Error",1,["egglog::Error"]],["impl !UnwindSafe for ResolvedVar",1,["egglog::ast::expr::ResolvedVar"]],["impl !UnwindSafe for AllEqualTypeConstraint",1,["egglog::constraint::AllEqualTypeConstraint"]],["impl !UnwindSafe for SimpleTypeConstraint",1,["egglog::constraint::SimpleTypeConstraint"]],["impl !UnwindSafe for FunctionSort",1,["egglog::sort::fn::FunctionSort"]],["impl !UnwindSafe for MapSort",1,["egglog::sort::map::MapSort"]],["impl !UnwindSafe for MultiSetSort",1,["egglog::sort::multiset::MultiSetSort"]],["impl !UnwindSafe for NotEqualPrimitive",1,["egglog::sort::unit::NotEqualPrimitive"]],["impl !UnwindSafe for SetSort",1,["egglog::sort::set::SetSort"]],["impl !UnwindSafe for VecSort",1,["egglog::sort::vec::VecSort"]],["impl !UnwindSafe for EGraph",1,["egglog::EGraph"]],["impl !UnwindSafe for Function",1,["egglog::function::Function"]],["impl !UnwindSafe for Primitive",1,["egglog::Primitive"]],["impl !UnwindSafe for SerializeConfig",1,["egglog::serialize::SerializeConfig"]],["impl !UnwindSafe for SimplePrimitive",1,["egglog::SimplePrimitive"]],["impl !UnwindSafe for TypeInfo",1,["egglog::typechecking::TypeInfo"]],["impl UnwindSafe for Change",1,["egglog::ast::Change"]],["impl UnwindSafe for Literal",1,["egglog::ast::expr::Literal"]],["impl UnwindSafe for Subdatatypes",1,["egglog::ast::Subdatatypes"]],["impl UnwindSafe for ParseError",1,["egglog::ast::parse::ParseError"]],["impl UnwindSafe for ExtractReport",1,["egglog::ExtractReport"]],["impl UnwindSafe for RunMode",1,["egglog::RunMode"]],["impl UnwindSafe for SerializedNode",1,["egglog::serialize::SerializedNode"]],["impl UnwindSafe for Term",1,["egglog::termdag::Term"]],["impl UnwindSafe for DUMMY_SPAN",1,["egglog::ast::parse::DUMMY_SPAN"]],["impl UnwindSafe for Span",1,["egglog::ast::parse::Span"]],["impl UnwindSafe for IdentSort",1,["egglog::ast::IdentSort"]],["impl UnwindSafe for Schema",1,["egglog::ast::Schema"]],["impl UnwindSafe for Variant",1,["egglog::ast::Variant"]],["impl UnwindSafe for BigIntSort",1,["egglog::sort::bigint::BigIntSort"]],["impl UnwindSafe for BigRatSort",1,["egglog::sort::bigrat::BigRatSort"]],["impl UnwindSafe for BoolSort",1,["egglog::sort::bool::BoolSort"]],["impl UnwindSafe for EqSort",1,["egglog::sort::EqSort"]],["impl UnwindSafe for F64Sort",1,["egglog::sort::f64::F64Sort"]],["impl UnwindSafe for I64Sort",1,["egglog::sort::i64::I64Sort"]],["impl UnwindSafe for RationalSort",1,["egglog::sort::rational::RationalSort"]],["impl UnwindSafe for StringSort",1,["egglog::sort::string::StringSort"]],["impl UnwindSafe for UnitSort",1,["egglog::sort::unit::UnitSort"]],["impl UnwindSafe for NotFoundError",1,["egglog::NotFoundError"]],["impl UnwindSafe for RunReport",1,["egglog::RunReport"]],["impl UnwindSafe for TermDag",1,["egglog::termdag::TermDag"]],["impl UnwindSafe for Value",1,["egglog::value::Value"]],["impl UnwindSafe for SymbolGen",1,["egglog::util::SymbolGen"]],["impl<Head, Leaf> UnwindSafe for GenericAction<Head, Leaf>
where\n Leaf: UnwindSafe,\n Head: UnwindSafe,
",1,["egglog::ast::GenericAction"]],["impl<Head, Leaf> UnwindSafe for GenericCommand<Head, Leaf>
where\n Leaf: UnwindSafe,\n Head: UnwindSafe,
",1,["egglog::ast::GenericCommand"]],["impl<Head, Leaf> UnwindSafe for GenericExpr<Head, Leaf>
where\n Leaf: UnwindSafe,\n Head: UnwindSafe,
",1,["egglog::ast::expr::GenericExpr"]],["impl<Head, Leaf> UnwindSafe for GenericFact<Head, Leaf>
where\n Leaf: UnwindSafe,\n Head: UnwindSafe,
",1,["egglog::ast::GenericFact"]],["impl<Head, Leaf> UnwindSafe for GenericNCommand<Head, Leaf>
where\n Leaf: UnwindSafe,\n Head: UnwindSafe,
",1,["egglog::ast::GenericNCommand"]],["impl<Head, Leaf> UnwindSafe for GenericSchedule<Head, Leaf>
where\n Leaf: UnwindSafe,\n Head: UnwindSafe,
",1,["egglog::ast::GenericSchedule"]],["impl<Head, Leaf> UnwindSafe for CorrespondingVar<Head, Leaf>
where\n Head: UnwindSafe,\n Leaf: UnwindSafe,
",1,["egglog::ast::CorrespondingVar"]],["impl<Head, Leaf> UnwindSafe for Facts<Head, Leaf>
where\n Leaf: UnwindSafe,\n Head: UnwindSafe,
",1,["egglog::ast::Facts"]],["impl<Head, Leaf> UnwindSafe for GenericActions<Head, Leaf>
where\n Leaf: UnwindSafe,\n Head: UnwindSafe,
",1,["egglog::ast::GenericActions"]],["impl<Head, Leaf> UnwindSafe for GenericFunctionDecl<Head, Leaf>
where\n Leaf: UnwindSafe,\n Head: UnwindSafe,
",1,["egglog::ast::GenericFunctionDecl"]],["impl<Head, Leaf> UnwindSafe for GenericRewrite<Head, Leaf>
where\n Leaf: UnwindSafe,\n Head: UnwindSafe,
",1,["egglog::ast::GenericRewrite"]],["impl<Head, Leaf> UnwindSafe for GenericRule<Head, Leaf>
where\n Leaf: UnwindSafe,\n Head: UnwindSafe,
",1,["egglog::ast::GenericRule"]],["impl<Head, Leaf> UnwindSafe for GenericRunConfig<Head, Leaf>
where\n Leaf: UnwindSafe,\n Head: UnwindSafe,
",1,["egglog::ast::GenericRunConfig"]],["impl<Var, Value> !UnwindSafe for Constraint<Var, Value>",1,["egglog::constraint::Constraint"]],["impl<Var, Value> !UnwindSafe for ConstraintError<Var, Value>",1,["egglog::constraint::ConstraintError"]],["impl<Var, Value> !UnwindSafe for Problem<Var, Value>",1,["egglog::constraint::Problem"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/core/str/traits/trait.FromStr.js b/docs/trait.impl/core/str/traits/trait.FromStr.js new file mode 100644 index 00000000..39fc3f79 --- /dev/null +++ b/docs/trait.impl/core/str/traits/trait.FromStr.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl FromStr for RunMode"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/egglog/ast/trait.ToSexp.js b/docs/trait.impl/egglog/ast/trait.ToSexp.js new file mode 100644 index 00000000..1c3c91f1 --- /dev/null +++ b/docs/trait.impl/egglog/ast/trait.ToSexp.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/egglog/constraint/trait.TypeConstraint.js b/docs/trait.impl/egglog/constraint/trait.TypeConstraint.js new file mode 100644 index 00000000..1c3c91f1 --- /dev/null +++ b/docs/trait.impl/egglog/constraint/trait.TypeConstraint.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/egglog/sort/trait.FromSort.js b/docs/trait.impl/egglog/sort/trait.FromSort.js new file mode 100644 index 00000000..1c3c91f1 --- /dev/null +++ b/docs/trait.impl/egglog/sort/trait.FromSort.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/egglog/sort/trait.IntoSort.js b/docs/trait.impl/egglog/sort/trait.IntoSort.js new file mode 100644 index 00000000..1c3c91f1 --- /dev/null +++ b/docs/trait.impl/egglog/sort/trait.IntoSort.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/egglog/sort/trait.Presort.js b/docs/trait.impl/egglog/sort/trait.Presort.js new file mode 100644 index 00000000..1c3c91f1 --- /dev/null +++ b/docs/trait.impl/egglog/sort/trait.Presort.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/egglog/sort/trait.Sort.js b/docs/trait.impl/egglog/sort/trait.Sort.js new file mode 100644 index 00000000..1c3c91f1 --- /dev/null +++ b/docs/trait.impl/egglog/sort/trait.Sort.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/egglog/trait.PrimitiveLike.js b/docs/trait.impl/egglog/trait.PrimitiveLike.js new file mode 100644 index 00000000..1c3c91f1 --- /dev/null +++ b/docs/trait.impl/egglog/trait.PrimitiveLike.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/egglog/util/trait.FreshGen.js b/docs/trait.impl/egglog/util/trait.FreshGen.js new file mode 100644 index 00000000..1c3c91f1 --- /dev/null +++ b/docs/trait.impl/egglog/util/trait.FreshGen.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/trait.impl/lazy_static/trait.LazyStatic.js b/docs/trait.impl/lazy_static/trait.LazyStatic.js new file mode 100644 index 00000000..08865f61 --- /dev/null +++ b/docs/trait.impl/lazy_static/trait.LazyStatic.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"egglog":[["impl LazyStatic for DUMMY_SPAN"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/type.impl/alloc/sync/struct.Arc.js b/docs/type.impl/alloc/sync/struct.Arc.js new file mode 100644 index 00000000..61c7f40f --- /dev/null +++ b/docs/type.impl/alloc/sync/struct.Arc.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"egglog":[["
source§

impl<T> Arc<T>
where\n T: ?Sized,

1.17.0 · source

pub unsafe fn from_raw(ptr: *const T) -> Arc<T>

Constructs an Arc<T> from a raw pointer.

\n

The raw pointer must have been previously returned by a call to\nArc<U>::into_raw with the following requirements:

\n
    \n
  • If U is sized, it must have the same size and alignment as T. This\nis trivially true if U is T.
  • \n
  • If U is unsized, its data pointer must have the same size and\nalignment as T. This is trivially true if Arc<U> was constructed\nthrough Arc<T> and then converted to Arc<U> through an unsized\ncoercion.
  • \n
\n

Note that if U or U’s data pointer is not T but has the same size\nand alignment, this is basically like transmuting references of\ndifferent types. See mem::transmute for more information\non what restrictions apply in this case.

\n

The user of from_raw has to make sure a specific value of T is only\ndropped once.

\n

This function is unsafe because improper use may lead to memory unsafety,\neven if the returned Arc<T> is never accessed.

\n
§Examples
\n
use std::sync::Arc;\n\nlet x = Arc::new(\"hello\".to_owned());\nlet x_ptr = Arc::into_raw(x);\n\nunsafe {\n    // Convert back to an `Arc` to prevent leak.\n    let x = Arc::from_raw(x_ptr);\n    assert_eq!(&*x, \"hello\");\n\n    // Further calls to `Arc::from_raw(x_ptr)` would be memory-unsafe.\n}\n\n// The memory was freed when `x` went out of scope above, so `x_ptr` is now dangling!
\n

Convert a slice back into its original array:

\n\n
use std::sync::Arc;\n\nlet x: Arc<[u32]> = Arc::new([1, 2, 3]);\nlet x_ptr: *const [u32] = Arc::into_raw(x);\n\nunsafe {\n    let x: Arc<[u32; 3]> = Arc::from_raw(x_ptr.cast::<[u32; 3]>());\n    assert_eq!(&*x, &[1, 2, 3]);\n}
\n
1.51.0 · source

pub unsafe fn increment_strong_count(ptr: *const T)

Increments the strong reference count on the Arc<T> associated with the\nprovided pointer by one.

\n
§Safety
\n

The pointer must have been obtained through Arc::into_raw, and the\nassociated Arc instance must be valid (i.e. the strong count must be at\nleast 1) for the duration of this method.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nunsafe {\n    let ptr = Arc::into_raw(five);\n    Arc::increment_strong_count(ptr);\n\n    // This assertion is deterministic because we haven't shared\n    // the `Arc` between threads.\n    let five = Arc::from_raw(ptr);\n    assert_eq!(2, Arc::strong_count(&five));\n}
\n
1.51.0 · source

pub unsafe fn decrement_strong_count(ptr: *const T)

Decrements the strong reference count on the Arc<T> associated with the\nprovided pointer by one.

\n
§Safety
\n

The pointer must have been obtained through Arc::into_raw, and the\nassociated Arc instance must be valid (i.e. the strong count must be at\nleast 1) when invoking this method. This method can be used to release the final\nArc and backing storage, but should not be called after the final Arc has been\nreleased.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nunsafe {\n    let ptr = Arc::into_raw(five);\n    Arc::increment_strong_count(ptr);\n\n    // Those assertions are deterministic because we haven't shared\n    // the `Arc` between threads.\n    let five = Arc::from_raw(ptr);\n    assert_eq!(2, Arc::strong_count(&five));\n    Arc::decrement_strong_count(ptr);\n    assert_eq!(1, Arc::strong_count(&five));\n}
\n
",0,"egglog::ArcSort"],["
source§

impl<T> Arc<T>

1.0.0 · source

pub fn new(data: T) -> Arc<T>

Constructs a new Arc<T>.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);
\n
1.60.0 · source

pub fn new_cyclic<F>(data_fn: F) -> Arc<T>
where\n F: FnOnce(&Weak<T>) -> T,

Constructs a new Arc<T> while giving you a Weak<T> to the allocation,\nto allow you to construct a T which holds a weak pointer to itself.

\n

Generally, a structure circularly referencing itself, either directly or\nindirectly, should not hold a strong reference to itself to prevent a memory leak.\nUsing this function, you get access to the weak pointer during the\ninitialization of T, before the Arc<T> is created, such that you can\nclone and store it inside the T.

\n

new_cyclic first allocates the managed allocation for the Arc<T>,\nthen calls your closure, giving it a Weak<T> to this allocation,\nand only afterwards completes the construction of the Arc<T> by placing\nthe T returned from your closure into the allocation.

\n

Since the new Arc<T> is not fully-constructed until Arc<T>::new_cyclic\nreturns, calling upgrade on the weak reference inside your closure will\nfail and result in a None value.

\n
§Panics
\n

If data_fn panics, the panic is propagated to the caller, and the\ntemporary Weak<T> is dropped normally.

\n
§Example
\n
use std::sync::{Arc, Weak};\n\nstruct Gadget {\n    me: Weak<Gadget>,\n}\n\nimpl Gadget {\n    /// Construct a reference counted Gadget.\n    fn new() -> Arc<Self> {\n        // `me` is a `Weak<Gadget>` pointing at the new allocation of the\n        // `Arc` we're constructing.\n        Arc::new_cyclic(|me| {\n            // Create the actual struct here.\n            Gadget { me: me.clone() }\n        })\n    }\n\n    /// Return a reference counted pointer to Self.\n    fn me(&self) -> Arc<Self> {\n        self.me.upgrade().unwrap()\n    }\n}
\n
source

pub fn new_uninit() -> Arc<MaybeUninit<T>>

🔬This is a nightly-only experimental API. (new_uninit)

Constructs a new Arc with uninitialized contents.

\n
§Examples
\n
#![feature(new_uninit)]\n#![feature(get_mut_unchecked)]\n\nuse std::sync::Arc;\n\nlet mut five = Arc::<u32>::new_uninit();\n\n// Deferred initialization:\nArc::get_mut(&mut five).unwrap().write(5);\n\nlet five = unsafe { five.assume_init() };\n\nassert_eq!(*five, 5)
\n
source

pub fn new_zeroed() -> Arc<MaybeUninit<T>>

🔬This is a nightly-only experimental API. (new_uninit)

Constructs a new Arc with uninitialized contents, with the memory\nbeing filled with 0 bytes.

\n

See MaybeUninit::zeroed for examples of correct and incorrect usage\nof this method.

\n
§Examples
\n
#![feature(new_uninit)]\n\nuse std::sync::Arc;\n\nlet zero = Arc::<u32>::new_zeroed();\nlet zero = unsafe { zero.assume_init() };\n\nassert_eq!(*zero, 0)
\n
1.33.0 · source

pub fn pin(data: T) -> Pin<Arc<T>>

Constructs a new Pin<Arc<T>>. If T does not implement Unpin, then\ndata will be pinned in memory and unable to be moved.

\n
source

pub fn try_pin(data: T) -> Result<Pin<Arc<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Pin<Arc<T>>, return an error if allocation fails.

\n
source

pub fn try_new(data: T) -> Result<Arc<T>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc<T>, returning an error if allocation fails.

\n
§Examples
\n
#![feature(allocator_api)]\nuse std::sync::Arc;\n\nlet five = Arc::try_new(5)?;
\n
source

pub fn try_new_uninit() -> Result<Arc<MaybeUninit<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc with uninitialized contents, returning an error\nif allocation fails.

\n
§Examples
\n
#![feature(new_uninit, allocator_api)]\n#![feature(get_mut_unchecked)]\n\nuse std::sync::Arc;\n\nlet mut five = Arc::<u32>::try_new_uninit()?;\n\n// Deferred initialization:\nArc::get_mut(&mut five).unwrap().write(5);\n\nlet five = unsafe { five.assume_init() };\n\nassert_eq!(*five, 5);
\n
source

pub fn try_new_zeroed() -> Result<Arc<MaybeUninit<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc with uninitialized contents, with the memory\nbeing filled with 0 bytes, returning an error if allocation fails.

\n

See MaybeUninit::zeroed for examples of correct and incorrect usage\nof this method.

\n
§Examples
\n
#![feature(new_uninit, allocator_api)]\n\nuse std::sync::Arc;\n\nlet zero = Arc::<u32>::try_new_zeroed()?;\nlet zero = unsafe { zero.assume_init() };\n\nassert_eq!(*zero, 0);
\n
",0,"egglog::ArcSort"],["
source§

impl<T, A> Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

1.17.0 · source

pub fn into_raw(this: Arc<T, A>) -> *const T

Consumes the Arc, returning the wrapped pointer.

\n

To avoid a memory leak the pointer must be converted back to an Arc using\nArc::from_raw.

\n
§Examples
\n
use std::sync::Arc;\n\nlet x = Arc::new(\"hello\".to_owned());\nlet x_ptr = Arc::into_raw(x);\nassert_eq!(unsafe { &*x_ptr }, \"hello\");
\n
1.45.0 · source

pub fn as_ptr(this: &Arc<T, A>) -> *const T

Provides a raw pointer to the data.

\n

The counts are not affected in any way and the Arc is not consumed. The pointer is valid for\nas long as there are strong counts in the Arc.

\n
§Examples
\n
use std::sync::Arc;\n\nlet x = Arc::new(\"hello\".to_owned());\nlet y = Arc::clone(&x);\nlet x_ptr = Arc::as_ptr(&x);\nassert_eq!(x_ptr, Arc::as_ptr(&y));\nassert_eq!(unsafe { &*x_ptr }, \"hello\");
\n
source

pub unsafe fn from_raw_in(ptr: *const T, alloc: A) -> Arc<T, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs an Arc<T, A> from a raw pointer.

\n

The raw pointer must have been previously returned by a call to Arc<U, A>::into_raw with the following requirements:

\n
    \n
  • If U is sized, it must have the same size and alignment as T. This\nis trivially true if U is T.
  • \n
  • If U is unsized, its data pointer must have the same size and\nalignment as T. This is trivially true if Arc<U> was constructed\nthrough Arc<T> and then converted to Arc<U> through an unsized\ncoercion.
  • \n
\n

Note that if U or U’s data pointer is not T but has the same size\nand alignment, this is basically like transmuting references of\ndifferent types. See mem::transmute for more information\non what restrictions apply in this case.

\n

The raw pointer must point to a block of memory allocated by alloc

\n

The user of from_raw has to make sure a specific value of T is only\ndropped once.

\n

This function is unsafe because improper use may lead to memory unsafety,\neven if the returned Arc<T> is never accessed.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet x = Arc::new_in(\"hello\".to_owned(), System);\nlet x_ptr = Arc::into_raw(x);\n\nunsafe {\n    // Convert back to an `Arc` to prevent leak.\n    let x = Arc::from_raw_in(x_ptr, System);\n    assert_eq!(&*x, \"hello\");\n\n    // Further calls to `Arc::from_raw(x_ptr)` would be memory-unsafe.\n}\n\n// The memory was freed when `x` went out of scope above, so `x_ptr` is now dangling!
\n

Convert a slice back into its original array:

\n\n
#![feature(allocator_api)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet x: Arc<[u32], _> = Arc::new_in([1, 2, 3], System);\nlet x_ptr: *const [u32] = Arc::into_raw(x);\n\nunsafe {\n    let x: Arc<[u32; 3], _> = Arc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);\n    assert_eq!(&*x, &[1, 2, 3]);\n}
\n
1.4.0 · source

pub fn downgrade(this: &Arc<T, A>) -> Weak<T, A>
where\n A: Clone,

Creates a new Weak pointer to this allocation.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nlet weak_five = Arc::downgrade(&five);
\n
1.15.0 · source

pub fn weak_count(this: &Arc<T, A>) -> usize

Gets the number of Weak pointers to this allocation.

\n
§Safety
\n

This method by itself is safe, but using it correctly requires extra care.\nAnother thread can change the weak count at any time,\nincluding potentially between calling this method and acting on the result.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\nlet _weak_five = Arc::downgrade(&five);\n\n// This assertion is deterministic because we haven't shared\n// the `Arc` or `Weak` between threads.\nassert_eq!(1, Arc::weak_count(&five));
\n
1.15.0 · source

pub fn strong_count(this: &Arc<T, A>) -> usize

Gets the number of strong (Arc) pointers to this allocation.

\n
§Safety
\n

This method by itself is safe, but using it correctly requires extra care.\nAnother thread can change the strong count at any time,\nincluding potentially between calling this method and acting on the result.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\nlet _also_five = Arc::clone(&five);\n\n// This assertion is deterministic because we haven't shared\n// the `Arc` between threads.\nassert_eq!(2, Arc::strong_count(&five));
\n
source

pub unsafe fn increment_strong_count_in(ptr: *const T, alloc: A)
where\n A: Clone,

🔬This is a nightly-only experimental API. (allocator_api)

Increments the strong reference count on the Arc<T> associated with the\nprovided pointer by one.

\n
§Safety
\n

The pointer must have been obtained through Arc::into_raw, and the\nassociated Arc instance must be valid (i.e. the strong count must be at\nleast 1) for the duration of this method,, and ptr must point to a block of memory\nallocated by alloc.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet five = Arc::new_in(5, System);\n\nunsafe {\n    let ptr = Arc::into_raw(five);\n    Arc::increment_strong_count_in(ptr, System);\n\n    // This assertion is deterministic because we haven't shared\n    // the `Arc` between threads.\n    let five = Arc::from_raw_in(ptr, System);\n    assert_eq!(2, Arc::strong_count(&five));\n}
\n
source

pub unsafe fn decrement_strong_count_in(ptr: *const T, alloc: A)

🔬This is a nightly-only experimental API. (allocator_api)

Decrements the strong reference count on the Arc<T> associated with the\nprovided pointer by one.

\n
§Safety
\n

The pointer must have been obtained through Arc::into_raw, the\nassociated Arc instance must be valid (i.e. the strong count must be at\nleast 1) when invoking this method, and ptr must point to a block of memory\nallocated by alloc. This method can be used to release the final\nArc and backing storage, but should not be called after the final Arc has been\nreleased.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet five = Arc::new_in(5, System);\n\nunsafe {\n    let ptr = Arc::into_raw(five);\n    Arc::increment_strong_count_in(ptr, System);\n\n    // Those assertions are deterministic because we haven't shared\n    // the `Arc` between threads.\n    let five = Arc::from_raw_in(ptr, System);\n    assert_eq!(2, Arc::strong_count(&five));\n    Arc::decrement_strong_count_in(ptr, System);\n    assert_eq!(1, Arc::strong_count(&five));\n}
\n
1.17.0 · source

pub fn ptr_eq(this: &Arc<T, A>, other: &Arc<T, A>) -> bool

Returns true if the two Arcs point to the same allocation in a vein similar to\nptr::eq. This function ignores the metadata of dyn Trait pointers.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\nlet same_five = Arc::clone(&five);\nlet other_five = Arc::new(5);\n\nassert!(Arc::ptr_eq(&five, &same_five));\nassert!(!Arc::ptr_eq(&five, &other_five));
\n
",0,"egglog::ArcSort"],["
source§

impl<T, A> Arc<T, A>
where\n T: Clone,\n A: Allocator + Clone,

1.4.0 · source

pub fn make_mut(this: &mut Arc<T, A>) -> &mut T

Makes a mutable reference into the given Arc.

\n

If there are other Arc pointers to the same allocation, then make_mut will\nclone the inner value to a new allocation to ensure unique ownership. This is also\nreferred to as clone-on-write.

\n

However, if there are no other Arc pointers to this allocation, but some Weak\npointers, then the Weak pointers will be dissociated and the inner value will not\nbe cloned.

\n

See also get_mut, which will fail rather than cloning the inner value\nor dissociating Weak pointers.

\n
§Examples
\n
use std::sync::Arc;\n\nlet mut data = Arc::new(5);\n\n*Arc::make_mut(&mut data) += 1;         // Won't clone anything\nlet mut other_data = Arc::clone(&data); // Won't clone inner data\n*Arc::make_mut(&mut data) += 1;         // Clones inner data\n*Arc::make_mut(&mut data) += 1;         // Won't clone anything\n*Arc::make_mut(&mut other_data) *= 2;   // Won't clone anything\n\n// Now `data` and `other_data` point to different allocations.\nassert_eq!(*data, 8);\nassert_eq!(*other_data, 12);
\n

Weak pointers will be dissociated:

\n\n
use std::sync::Arc;\n\nlet mut data = Arc::new(75);\nlet weak = Arc::downgrade(&data);\n\nassert!(75 == *data);\nassert!(75 == *weak.upgrade().unwrap());\n\n*Arc::make_mut(&mut data) += 1;\n\nassert!(76 == *data);\nassert!(weak.upgrade().is_none());
\n
1.76.0 · source

pub fn unwrap_or_clone(this: Arc<T, A>) -> T

If we have the only reference to T then unwrap it. Otherwise, clone T and return the\nclone.

\n

Assuming arc_t is of type Arc<T>, this function is functionally equivalent to\n(*arc_t).clone(), but will avoid cloning the inner value where possible.

\n
§Examples
\n
let inner = String::from(\"test\");\nlet ptr = inner.as_ptr();\n\nlet arc = Arc::new(inner);\nlet inner = Arc::unwrap_or_clone(arc);\n// The inner value was not cloned\nassert!(ptr::eq(ptr, inner.as_ptr()));\n\nlet arc = Arc::new(inner);\nlet arc2 = arc.clone();\nlet inner = Arc::unwrap_or_clone(arc);\n// Because there were 2 references, we had to clone the inner value.\nassert!(!ptr::eq(ptr, inner.as_ptr()));\n// `arc2` is the last reference, so when we unwrap it we get back\n// the original `String`.\nlet inner = Arc::unwrap_or_clone(arc2);\nassert!(ptr::eq(ptr, inner.as_ptr()));
\n
",0,"egglog::ArcSort"],["
source§

impl<T, A> Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

1.4.0 · source

pub fn get_mut(this: &mut Arc<T, A>) -> Option<&mut T>

Returns a mutable reference into the given Arc, if there are\nno other Arc or Weak pointers to the same allocation.

\n

Returns None otherwise, because it is not safe to\nmutate a shared value.

\n

See also make_mut, which will clone\nthe inner value when there are other Arc pointers.

\n
§Examples
\n
use std::sync::Arc;\n\nlet mut x = Arc::new(3);\n*Arc::get_mut(&mut x).unwrap() = 4;\nassert_eq!(*x, 4);\n\nlet _y = Arc::clone(&x);\nassert!(Arc::get_mut(&mut x).is_none());
\n
source

pub unsafe fn get_mut_unchecked(this: &mut Arc<T, A>) -> &mut T

🔬This is a nightly-only experimental API. (get_mut_unchecked)

Returns a mutable reference into the given Arc,\nwithout any check.

\n

See also get_mut, which is safe and does appropriate checks.

\n
§Safety
\n

If any other Arc or Weak pointers to the same allocation exist, then\nthey must not be dereferenced or have active borrows for the duration\nof the returned borrow, and their inner type must be exactly the same as the\ninner type of this Rc (including lifetimes). This is trivially the case if no\nsuch pointers exist, for example immediately after Arc::new.

\n
§Examples
\n
#![feature(get_mut_unchecked)]\n\nuse std::sync::Arc;\n\nlet mut x = Arc::new(String::new());\nunsafe {\n    Arc::get_mut_unchecked(&mut x).push_str(\"foo\")\n}\nassert_eq!(*x, \"foo\");
\n

Other Arc pointers to the same allocation must be to the same type.

\n\n
#![feature(get_mut_unchecked)]\n\nuse std::sync::Arc;\n\nlet x: Arc<str> = Arc::from(\"Hello, world!\");\nlet mut y: Arc<[u8]> = x.clone().into();\nunsafe {\n    // this is Undefined Behavior, because x's inner type is str, not [u8]\n    Arc::get_mut_unchecked(&mut y).fill(0xff); // 0xff is invalid in UTF-8\n}\nprintln!(\"{}\", &*x); // Invalid UTF-8 in a str
\n

Other Arc pointers to the same allocation must be to the exact same type, including lifetimes.

\n\n
#![feature(get_mut_unchecked)]\n\nuse std::sync::Arc;\n\nlet x: Arc<&str> = Arc::new(\"Hello, world!\");\n{\n    let s = String::from(\"Oh, no!\");\n    let mut y: Arc<&str> = x.clone().into();\n    unsafe {\n        // this is Undefined Behavior, because x's inner type\n        // is &'long str, not &'short str\n        *Arc::get_mut_unchecked(&mut y) = &s;\n    }\n}\nprintln!(\"{}\", &*x); // Use-after-free
\n
",0,"egglog::ArcSort"],["
source§

impl<T, A> Arc<T, A>
where\n A: Allocator,

source

pub fn allocator(this: &Arc<T, A>) -> &A

🔬This is a nightly-only experimental API. (allocator_api)

Returns a reference to the underlying allocator.

\n

Note: this is an associated function, which means that you have\nto call it as Arc::allocator(&a) instead of a.allocator(). This\nis so that there is no conflict with a method on the inner type.

\n
source

pub fn new_in(data: T, alloc: A) -> Arc<T, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc<T> in the provided allocator.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet five = Arc::new_in(5, System);
\n
source

pub fn new_uninit_in(alloc: A) -> Arc<MaybeUninit<T>, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc with uninitialized contents in the provided allocator.

\n
§Examples
\n
#![feature(new_uninit)]\n#![feature(get_mut_unchecked)]\n#![feature(allocator_api)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet mut five = Arc::<u32, _>::new_uninit_in(System);\n\nlet five = unsafe {\n    // Deferred initialization:\n    Arc::get_mut_unchecked(&mut five).as_mut_ptr().write(5);\n\n    five.assume_init()\n};\n\nassert_eq!(*five, 5)
\n
source

pub fn new_zeroed_in(alloc: A) -> Arc<MaybeUninit<T>, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc with uninitialized contents, with the memory\nbeing filled with 0 bytes, in the provided allocator.

\n

See MaybeUninit::zeroed for examples of correct and incorrect usage\nof this method.

\n
§Examples
\n
#![feature(new_uninit)]\n#![feature(allocator_api)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet zero = Arc::<u32, _>::new_zeroed_in(System);\nlet zero = unsafe { zero.assume_init() };\n\nassert_eq!(*zero, 0)
\n
source

pub fn pin_in(data: T, alloc: A) -> Pin<Arc<T, A>>
where\n A: 'static,

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Pin<Arc<T, A>> in the provided allocator. If T does not implement Unpin,\nthen data will be pinned in memory and unable to be moved.

\n
source

pub fn try_pin_in(data: T, alloc: A) -> Result<Pin<Arc<T, A>>, AllocError>
where\n A: 'static,

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Pin<Arc<T, A>> in the provided allocator, return an error if allocation\nfails.

\n
source

pub fn try_new_in(data: T, alloc: A) -> Result<Arc<T, A>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc<T, A> in the provided allocator, returning an error if allocation fails.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet five = Arc::try_new_in(5, System)?;
\n
source

pub fn try_new_uninit_in(alloc: A) -> Result<Arc<MaybeUninit<T>, A>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc with uninitialized contents, in the provided allocator, returning an\nerror if allocation fails.

\n
§Examples
\n
#![feature(new_uninit, allocator_api)]\n#![feature(get_mut_unchecked)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet mut five = Arc::<u32, _>::try_new_uninit_in(System)?;\n\nlet five = unsafe {\n    // Deferred initialization:\n    Arc::get_mut_unchecked(&mut five).as_mut_ptr().write(5);\n\n    five.assume_init()\n};\n\nassert_eq!(*five, 5);
\n
source

pub fn try_new_zeroed_in(alloc: A) -> Result<Arc<MaybeUninit<T>, A>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc with uninitialized contents, with the memory\nbeing filled with 0 bytes, in the provided allocator, returning an error if allocation\nfails.

\n

See MaybeUninit::zeroed for examples of correct and incorrect usage\nof this method.

\n
§Examples
\n
#![feature(new_uninit, allocator_api)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet zero = Arc::<u32, _>::try_new_zeroed_in(System)?;\nlet zero = unsafe { zero.assume_init() };\n\nassert_eq!(*zero, 0);
\n
1.4.0 · source

pub fn try_unwrap(this: Arc<T, A>) -> Result<T, Arc<T, A>>

Returns the inner value, if the Arc has exactly one strong reference.

\n

Otherwise, an Err is returned with the same Arc that was\npassed in.

\n

This will succeed even if there are outstanding weak references.

\n

It is strongly recommended to use Arc::into_inner instead if you don’t\nwant to keep the Arc in the Err case.\nImmediately dropping the Err payload, like in the expression\nArc::try_unwrap(this).ok(), can still cause the strong count to\ndrop to zero and the inner value of the Arc to be dropped:\nFor instance if two threads each execute this expression in parallel, then\nthere is a race condition. The threads could first both check whether they\nhave the last clone of their Arc via Arc::try_unwrap, and then\nboth drop their Arc in the call to ok,\ntaking the strong count from two down to zero.

\n
§Examples
\n
use std::sync::Arc;\n\nlet x = Arc::new(3);\nassert_eq!(Arc::try_unwrap(x), Ok(3));\n\nlet x = Arc::new(4);\nlet _y = Arc::clone(&x);\nassert_eq!(*Arc::try_unwrap(x).unwrap_err(), 4);
\n
1.70.0 · source

pub fn into_inner(this: Arc<T, A>) -> Option<T>

Returns the inner value, if the Arc has exactly one strong reference.

\n

Otherwise, None is returned and the Arc is dropped.

\n

This will succeed even if there are outstanding weak references.

\n

If Arc::into_inner is called on every clone of this Arc,\nit is guaranteed that exactly one of the calls returns the inner value.\nThis means in particular that the inner value is not dropped.

\n

Arc::try_unwrap is conceptually similar to Arc::into_inner, but it\nis meant for different use-cases. If used as a direct replacement\nfor Arc::into_inner anyway, such as with the expression\nArc::try_unwrap(this).ok(), then it does\nnot give the same guarantee as described in the previous paragraph.\nFor more information, see the examples below and read the documentation\nof Arc::try_unwrap.

\n
§Examples
\n

Minimal example demonstrating the guarantee that Arc::into_inner gives.

\n\n
use std::sync::Arc;\n\nlet x = Arc::new(3);\nlet y = Arc::clone(&x);\n\n// Two threads calling `Arc::into_inner` on both clones of an `Arc`:\nlet x_thread = std::thread::spawn(|| Arc::into_inner(x));\nlet y_thread = std::thread::spawn(|| Arc::into_inner(y));\n\nlet x_inner_value = x_thread.join().unwrap();\nlet y_inner_value = y_thread.join().unwrap();\n\n// One of the threads is guaranteed to receive the inner value:\nassert!(matches!(\n    (x_inner_value, y_inner_value),\n    (None, Some(3)) | (Some(3), None)\n));\n// The result could also be `(None, None)` if the threads called\n// `Arc::try_unwrap(x).ok()` and `Arc::try_unwrap(y).ok()` instead.
\n

A more practical example demonstrating the need for Arc::into_inner:

\n\n
use std::sync::Arc;\n\n// Definition of a simple singly linked list using `Arc`:\n#[derive(Clone)]\nstruct LinkedList<T>(Option<Arc<Node<T>>>);\nstruct Node<T>(T, Option<Arc<Node<T>>>);\n\n// Dropping a long `LinkedList<T>` relying on the destructor of `Arc`\n// can cause a stack overflow. To prevent this, we can provide a\n// manual `Drop` implementation that does the destruction in a loop:\nimpl<T> Drop for LinkedList<T> {\n    fn drop(&mut self) {\n        let mut link = self.0.take();\n        while let Some(arc_node) = link.take() {\n            if let Some(Node(_value, next)) = Arc::into_inner(arc_node) {\n                link = next;\n            }\n        }\n    }\n}\n\n// Implementation of `new` and `push` omitted\nimpl<T> LinkedList<T> {\n    /* ... */\n}\n\n// The following code could have still caused a stack overflow\n// despite the manual `Drop` impl if that `Drop` impl had used\n// `Arc::try_unwrap(arc).ok()` instead of `Arc::into_inner(arc)`.\n\n// Create a long list and clone it\nlet mut x = LinkedList::new();\nlet size = 100000;\nfor i in 0..size {\n    x.push(i); // Adds i to the front of x\n}\nlet y = x.clone();\n\n// Drop the clones in parallel\nlet x_thread = std::thread::spawn(|| drop(x));\nlet y_thread = std::thread::spawn(|| drop(y));\nx_thread.join().unwrap();\ny_thread.join().unwrap();
\n
",0,"egglog::ArcSort"],["
1.64.0 · source§

impl<T> AsFd for Arc<T>
where\n T: AsFd + ?Sized,

This impl allows implementing traits that require AsFd on Arc.

\n\n
use std::net::UdpSocket;\nuse std::sync::Arc;\n\ntrait MyTrait: AsFd {}\nimpl MyTrait for Arc<UdpSocket> {}\nimpl MyTrait for Box<UdpSocket> {}
\n
source§

fn as_fd(&self) -> BorrowedFd<'_>

Borrows the file descriptor. Read more
","AsFd","egglog::ArcSort"],["
1.63.0 · source§

impl<T> AsRawFd for Arc<T>
where\n T: AsRawFd,

This impl allows implementing traits that require AsRawFd on Arc.

\n\n
use std::net::UdpSocket;\nuse std::sync::Arc;\ntrait MyTrait: AsRawFd {\n}\nimpl MyTrait for Arc<UdpSocket> {}\nimpl MyTrait for Box<UdpSocket> {}
\n
source§

fn as_raw_fd(&self) -> i32

Extracts the raw file descriptor. Read more
","AsRawFd","egglog::ArcSort"],["
1.5.0 · source§

impl<T, A> AsRef<T> for Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef","egglog::ArcSort"],["
1.0.0 · source§

impl<T, A> Borrow<T> for Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
","Borrow","egglog::ArcSort"],["
1.0.0 · source§

impl<T, A> Clone for Arc<T, A>
where\n A: Allocator + Clone,\n T: ?Sized,

source§

fn clone(&self) -> Arc<T, A>

Makes a clone of the Arc pointer.

\n

This creates another pointer to the same allocation, increasing the\nstrong reference count.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nlet _ = Arc::clone(&five);
\n
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","egglog::ArcSort"],["
1.0.0 · source§

impl<T, A> Debug for Arc<T, A>
where\n T: Debug + ?Sized,\n A: Allocator,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","egglog::ArcSort"],["
1.0.0 · source§

impl<T> Default for Arc<T>
where\n T: Default,

source§

fn default() -> Arc<T>

Creates a new Arc<T>, with the Default value for T.

\n
§Examples
\n
use std::sync::Arc;\n\nlet x: Arc<i32> = Default::default();\nassert_eq!(*x, 0);
\n
","Default","egglog::ArcSort"],["
source§

impl<'de, T> Deserialize<'de> for Arc<T>
where\n Box<T>: Deserialize<'de>,\n T: ?Sized,

This impl requires the "rc" Cargo feature of Serde.

\n

Deserializing a data structure containing Arc will not attempt to\ndeduplicate Arc references to the same data. Every deserialized Arc\nwill end up with a strong count of 1.

\n
source§

fn deserialize<D>(\n deserializer: D\n) -> Result<Arc<T>, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","egglog::ArcSort"],["
1.0.0 · source§

impl<T, A> Display for Arc<T, A>
where\n T: Display + ?Sized,\n A: Allocator,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Display","egglog::ArcSort"],["
1.0.0 · source§

impl<T, A> Drop for Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

source§

fn drop(&mut self)

Drops the Arc.

\n

This will decrement the strong reference count. If the strong reference\ncount reaches zero then the only other references (if any) are\nWeak, so we drop the inner value.

\n
§Examples
\n
use std::sync::Arc;\n\nstruct Foo;\n\nimpl Drop for Foo {\n    fn drop(&mut self) {\n        println!(\"dropped!\");\n    }\n}\n\nlet foo  = Arc::new(Foo);\nlet foo2 = Arc::clone(&foo);\n\ndrop(foo);    // Doesn't print anything\ndrop(foo2);   // Prints \"dropped!\"
\n
","Drop","egglog::ArcSort"],["
1.52.0 · source§

impl<T> Error for Arc<T>
where\n T: Error + ?Sized,

source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
source§

fn provide<'a>(&'a self, req: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
","Error","egglog::ArcSort"],["
1.21.0 · source§

impl<T, A> From<Box<T, A>> for Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

source§

fn from(v: Box<T, A>) -> Arc<T, A>

Move a boxed object to a new, reference-counted allocation.

\n
§Example
\n
let unique: Box<str> = Box::from(\"eggplant\");\nlet shared: Arc<str> = Arc::from(unique);\nassert_eq!(\"eggplant\", &shared[..]);
\n
","From>","egglog::ArcSort"],["
1.45.0 · source§

impl<'a, B> From<Cow<'a, B>> for Arc<B>
where\n B: ToOwned + ?Sized,\n Arc<B>: From<&'a B> + From<<B as ToOwned>::Owned>,

source§

fn from(cow: Cow<'a, B>) -> Arc<B>

Create an atomically reference-counted pointer from\na clone-on-write pointer by copying its content.

\n
§Example
\n
let cow: Cow<'_, str> = Cow::Borrowed(\"eggplant\");\nlet shared: Arc<str> = Arc::from(cow);\nassert_eq!(\"eggplant\", &shared[..]);
\n
","From>","egglog::ArcSort"],["
1.6.0 · source§

impl<T> From<T> for Arc<T>

source§

fn from(t: T) -> Arc<T>

Converts a T into an Arc<T>

\n

The conversion moves the value into a\nnewly allocated Arc. It is equivalent to\ncalling Arc::new(t).

\n
§Example
\n
let x = 5;\nlet arc = Arc::new(5);\n\nassert_eq!(Arc::from(x), arc);
\n
","From","egglog::ArcSort"],["
1.0.0 · source§

impl<T, A> Hash for Arc<T, A>
where\n T: Hash + ?Sized,\n A: Allocator,

source§

fn hash<H>(&self, state: &mut H)
where\n H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","egglog::ArcSort"],["
source§

impl<T> Log for Arc<T>
where\n T: Log + ?Sized,

source§

fn enabled(&self, metadata: &Metadata<'_>) -> bool

Determines if a log message with the specified metadata would be\nlogged. Read more
source§

fn log(&self, record: &Record<'_>)

Logs the Record. Read more
source§

fn flush(&self)

Flushes any buffered records. Read more
","Log","egglog::ArcSort"],["
1.0.0 · source§

impl<T, A> Ord for Arc<T, A>
where\n T: Ord + ?Sized,\n A: Allocator,

source§

fn cmp(&self, other: &Arc<T, A>) -> Ordering

Comparison for two Arcs.

\n

The two are compared by calling cmp() on their inner values.

\n
§Examples
\n
use std::sync::Arc;\nuse std::cmp::Ordering;\n\nlet five = Arc::new(5);\n\nassert_eq!(Ordering::Less, five.cmp(&Arc::new(6)));
\n
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","egglog::ArcSort"],["
1.0.0 · source§

impl<T, A> PartialEq for Arc<T, A>
where\n T: PartialEq + ?Sized,\n A: Allocator,

source§

fn eq(&self, other: &Arc<T, A>) -> bool

Equality for two Arcs.

\n

Two Arcs are equal if their inner values are equal, even if they are\nstored in different allocation.

\n

If T also implements Eq (implying reflexivity of equality),\ntwo Arcs that point to the same allocation are always equal.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nassert!(five == Arc::new(5));
\n
source§

fn ne(&self, other: &Arc<T, A>) -> bool

Inequality for two Arcs.

\n

Two Arcs are not equal if their inner values are not equal.

\n

If T also implements Eq (implying reflexivity of equality),\ntwo Arcs that point to the same value are always equal.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nassert!(five != Arc::new(6));
\n
","PartialEq","egglog::ArcSort"],["
1.0.0 · source§

impl<T, A> PartialOrd for Arc<T, A>
where\n T: PartialOrd + ?Sized,\n A: Allocator,

source§

fn partial_cmp(&self, other: &Arc<T, A>) -> Option<Ordering>

Partial comparison for two Arcs.

\n

The two are compared by calling partial_cmp() on their inner values.

\n
§Examples
\n
use std::sync::Arc;\nuse std::cmp::Ordering;\n\nlet five = Arc::new(5);\n\nassert_eq!(Some(Ordering::Less), five.partial_cmp(&Arc::new(6)));
\n
source§

fn lt(&self, other: &Arc<T, A>) -> bool

Less-than comparison for two Arcs.

\n

The two are compared by calling < on their inner values.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nassert!(five < Arc::new(6));
\n
source§

fn le(&self, other: &Arc<T, A>) -> bool

‘Less than or equal to’ comparison for two Arcs.

\n

The two are compared by calling <= on their inner values.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nassert!(five <= Arc::new(5));
\n
source§

fn gt(&self, other: &Arc<T, A>) -> bool

Greater-than comparison for two Arcs.

\n

The two are compared by calling > on their inner values.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nassert!(five > Arc::new(4));
\n
source§

fn ge(&self, other: &Arc<T, A>) -> bool

‘Greater than or equal to’ comparison for two Arcs.

\n

The two are compared by calling >= on their inner values.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nassert!(five >= Arc::new(5));
\n
","PartialOrd","egglog::ArcSort"],["
1.0.0 · source§

impl<T, A> Pointer for Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter.
","Pointer","egglog::ArcSort"],["
source§

impl<T> Serialize for Arc<T>
where\n T: Serialize + ?Sized,

This impl requires the "rc" Cargo feature of Serde.

\n

Serializing a data structure containing Arc will serialize a copy of\nthe contents of the Arc each time the Arc is referenced within the\ndata structure. Serialization will not attempt to deduplicate these\nrepeated data.

\n
source§

fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","egglog::ArcSort"],["
1.0.0 · source§

impl<T, A> Deref for Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
","Deref","egglog::ArcSort"],["
source§

impl<T, U, A> CoerceUnsized<Arc<U, A>> for Arc<T, A>
where\n T: Unsize<U> + ?Sized,\n A: Allocator,\n U: ?Sized,

","CoerceUnsized>","egglog::ArcSort"],["
source§

impl<T, A> DerefPure for Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

","DerefPure","egglog::ArcSort"],["
source§

impl<T, U> DispatchFromDyn<Arc<U>> for Arc<T>
where\n T: Unsize<U> + ?Sized,\n U: ?Sized,

","DispatchFromDyn>","egglog::ArcSort"],["
1.0.0 · source§

impl<T, A> Eq for Arc<T, A>
where\n T: Eq + ?Sized,\n A: Allocator,

","Eq","egglog::ArcSort"],["
1.0.0 · source§

impl<T, A> Send for Arc<T, A>
where\n T: Sync + Send + ?Sized,\n A: Allocator + Send,

","Send","egglog::ArcSort"],["
1.0.0 · source§

impl<T, A> Sync for Arc<T, A>
where\n T: Sync + Send + ?Sized,\n A: Allocator + Sync,

","Sync","egglog::ArcSort"],["
1.33.0 · source§

impl<T, A> Unpin for Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

","Unpin","egglog::ArcSort"],["
1.9.0 · source§

impl<T, A> UnwindSafe for Arc<T, A>
where\n T: RefUnwindSafe + ?Sized,\n A: Allocator + UnwindSafe,

","UnwindSafe","egglog::ArcSort"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/type.impl/egglog/ast/enum.GenericAction.js b/docs/type.impl/egglog/ast/enum.GenericAction.js new file mode 100644 index 00000000..31b5b7f8 --- /dev/null +++ b/docs/type.impl/egglog/ast/enum.GenericAction.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"egglog":[["
source§

impl<Head, Leaf> Clone for GenericAction<Head, Leaf>
where\n Head: Clone + Display + Clone,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Clone,

source§

fn clone(&self) -> GenericAction<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","egglog::ast::Action"],["
source§

impl<Head, Leaf> Debug for GenericAction<Head, Leaf>
where\n Head: Clone + Display + Debug,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Debug","egglog::ast::Action"],["
source§

impl<Head, Leaf> Display for GenericAction<Head, Leaf>
where\n Head: Clone + Display + ToSexp,\n Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Display","egglog::ast::Action"],["
source§

impl<Head, Leaf> GenericAction<Head, Leaf>
where\n Head: Clone + Display,\n Leaf: Clone + Eq + Display + Hash,

source

pub fn map_exprs(\n &self,\n f: &mut impl FnMut(&GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>\n) -> Self

source

pub fn visit_exprs(\n self,\n f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>\n) -> Self

Applys f to all sub-expressions (including self)\nbottom-up, collecting the results.

\n
source

pub fn subst(\n &self,\n subst: &mut impl FnMut(&Span, &Leaf) -> GenericExpr<Head, Leaf>\n) -> Self

source

pub fn map_def_use(self, fvar: &mut impl FnMut(Leaf, bool) -> Leaf) -> Self

",0,"egglog::ast::Action"],["
source§

impl<Head, Leaf> Hash for GenericAction<Head, Leaf>
where\n Head: Clone + Display + Hash,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Hash,

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","egglog::ast::Action"],["
source§

impl<Head, Leaf> PartialEq for GenericAction<Head, Leaf>
where\n Head: Clone + Display + PartialEq,\n Leaf: Clone + PartialEq + Eq + Display + Hash + PartialEq,

source§

fn eq(&self, other: &GenericAction<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","egglog::ast::Action"],["
source§

impl<Head, Leaf> ToSexp for GenericAction<Head, Leaf>
where\n Head: Clone + Display + ToSexp,\n Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source§

fn to_sexp(&self) -> Sexp

","ToSexp","egglog::ast::Action"],["
source§

impl<Head, Leaf> Eq for GenericAction<Head, Leaf>
where\n Head: Clone + Display + Eq,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Eq,

","Eq","egglog::ast::Action"],["
source§

impl<Head, Leaf> StructuralPartialEq for GenericAction<Head, Leaf>
where\n Head: Clone + Display,\n Leaf: Clone + PartialEq + Eq + Display + Hash,

","StructuralPartialEq","egglog::ast::Action"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/type.impl/egglog/ast/enum.GenericCommand.js b/docs/type.impl/egglog/ast/enum.GenericCommand.js new file mode 100644 index 00000000..529d7388 --- /dev/null +++ b/docs/type.impl/egglog/ast/enum.GenericCommand.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"egglog":[["
source§

impl<Head, Leaf> Clone for GenericCommand<Head, Leaf>
where\n Head: Clone + Display + Clone,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Clone,

source§

fn clone(&self) -> GenericCommand<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","egglog::ast::Command"],["
source§

impl<Head, Leaf> Debug for GenericCommand<Head, Leaf>
where\n Head: Clone + Display + Debug,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Debug","egglog::ast::Command"],["
source§

impl<Head, Leaf> Display for GenericCommand<Head, Leaf>
where\n Head: Clone + Display + ToSexp,\n Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Display","egglog::ast::Command"],["
source§

impl<Head, Leaf> ToSexp for GenericCommand<Head, Leaf>
where\n Head: Clone + Display + ToSexp,\n Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source§

fn to_sexp(&self) -> Sexp

","ToSexp","egglog::ast::Command"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/type.impl/egglog/ast/enum.GenericExpr.js b/docs/type.impl/egglog/ast/enum.GenericExpr.js new file mode 100644 index 00000000..52d017a0 --- /dev/null +++ b/docs/type.impl/egglog/ast/enum.GenericExpr.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"egglog":[["
source§

impl<Head: Clone, Leaf: Clone> Clone for GenericExpr<Head, Leaf>

source§

fn clone(&self) -> GenericExpr<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","egglog::ast::expr::Expr"],["
source§

impl<Head: Debug, Leaf: Debug> Debug for GenericExpr<Head, Leaf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Debug","egglog::ast::expr::Expr"],["
source§

impl<Head, Leaf> Display for GenericExpr<Head, Leaf>
where\n Head: Display,\n Leaf: Display,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Display","egglog::ast::expr::Expr"],["
source§

impl<Head: Clone + Display, Leaf: Hash + Clone + Display + Eq> GenericExpr<Head, Leaf>

source

pub fn span(&self) -> Span

source

pub fn is_var(&self) -> bool

source

pub fn get_var(&self) -> Option<Leaf>

source

pub fn ast_size(&self) -> usize

source

pub fn walk(&self, pre: &mut impl FnMut(&Self), post: &mut impl FnMut(&Self))

source

pub fn fold<Out>(&self, f: &mut impl FnMut(&Self, Vec<Out>) -> Out) -> Out

source

pub fn visit_exprs(self, f: &mut impl FnMut(Self) -> Self) -> Self

Applys f to all sub-expressions (including self)\nbottom-up, collecting the results.

\n
source

pub fn subst<Head2, Leaf2>(\n &self,\n subst_leaf: &mut impl FnMut(&Span, &Leaf) -> GenericExpr<Head2, Leaf2>,\n subst_head: &mut impl FnMut(&Head) -> Head2\n) -> GenericExpr<Head2, Leaf2>

subst replaces occurrences of variables and head symbols in the expression.

\n
source

pub fn subst_leaf<Leaf2>(\n &self,\n subst_leaf: &mut impl FnMut(&Span, &Leaf) -> GenericExpr<Head, Leaf2>\n) -> GenericExpr<Head, Leaf2>

source

pub fn vars(&self) -> impl Iterator<Item = Leaf> + '_

",0,"egglog::ast::expr::Expr"],["
source§

impl<Head: Display, Leaf: Display> GenericExpr<Head, Leaf>

source

pub fn to_sexp(&self) -> Sexp

Converts this expression into a\ns-expression (symbolic expression).\nExample: (Add (Add 2 3) 4)

\n
",0,"egglog::ast::expr::Expr"],["
source§

impl<Head: Hash, Leaf: Hash> Hash for GenericExpr<Head, Leaf>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","egglog::ast::expr::Expr"],["
source§

impl<Head: PartialEq, Leaf: PartialEq> PartialEq for GenericExpr<Head, Leaf>

source§

fn eq(&self, other: &GenericExpr<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","egglog::ast::expr::Expr"],["
source§

impl<Head: Eq, Leaf: Eq> Eq for GenericExpr<Head, Leaf>

","Eq","egglog::ast::expr::Expr"],["
source§

impl<Head, Leaf> StructuralPartialEq for GenericExpr<Head, Leaf>

","StructuralPartialEq","egglog::ast::expr::Expr"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/type.impl/egglog/ast/enum.GenericFact.js b/docs/type.impl/egglog/ast/enum.GenericFact.js new file mode 100644 index 00000000..81347fc8 --- /dev/null +++ b/docs/type.impl/egglog/ast/enum.GenericFact.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"egglog":[["
source§

impl<Head: Clone, Leaf: Clone> Clone for GenericFact<Head, Leaf>

source§

fn clone(&self) -> GenericFact<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","egglog::ast::Fact"],["
source§

impl<Head: Debug, Leaf: Debug> Debug for GenericFact<Head, Leaf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Debug","egglog::ast::Fact"],["
source§

impl<Head, Leaf> Display for GenericFact<Head, Leaf>
where\n Head: Display,\n Leaf: Display,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Display","egglog::ast::Fact"],["
source§

impl<Head: Hash, Leaf: Hash> Hash for GenericFact<Head, Leaf>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","egglog::ast::Fact"],["
source§

impl<Head: PartialEq, Leaf: PartialEq> PartialEq for GenericFact<Head, Leaf>

source§

fn eq(&self, other: &GenericFact<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","egglog::ast::Fact"],["
source§

impl<Head, Leaf> ToSexp for GenericFact<Head, Leaf>
where\n Head: Display,\n Leaf: Display,

source§

fn to_sexp(&self) -> Sexp

","ToSexp","egglog::ast::Fact"],["
source§

impl<Head: Eq, Leaf: Eq> Eq for GenericFact<Head, Leaf>

","Eq","egglog::ast::Fact"],["
source§

impl<Head, Leaf> StructuralPartialEq for GenericFact<Head, Leaf>

","StructuralPartialEq","egglog::ast::Fact"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/type.impl/egglog/ast/enum.GenericNCommand.js b/docs/type.impl/egglog/ast/enum.GenericNCommand.js new file mode 100644 index 00000000..0e174995 --- /dev/null +++ b/docs/type.impl/egglog/ast/enum.GenericNCommand.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"egglog":[["
source§

impl<Head, Leaf> Clone for GenericNCommand<Head, Leaf>
where\n Head: Clone + Display + Clone,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Clone,

source§

fn clone(&self) -> GenericNCommand<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","egglog::ast::NCommand"],["
source§

impl<Head, Leaf> Debug for GenericNCommand<Head, Leaf>
where\n Head: Clone + Display + Debug,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Debug","egglog::ast::NCommand"],["
source§

impl<Head, Leaf> Display for GenericNCommand<Head, Leaf>
where\n Head: Clone + Display + ToSexp,\n Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Display","egglog::ast::NCommand"],["
source§

impl<Head, Leaf> GenericNCommand<Head, Leaf>
where\n Head: Clone + Display,\n Leaf: Clone + PartialEq + Eq + Display + Hash,

source

pub fn to_command(&self) -> GenericCommand<Head, Leaf>

source

pub fn visit_exprs(\n self,\n f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>\n) -> Self

",0,"egglog::ast::NCommand"],["
source§

impl<Head, Leaf> Hash for GenericNCommand<Head, Leaf>
where\n Head: Clone + Display + Hash,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Hash,

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","egglog::ast::NCommand"],["
source§

impl<Head, Leaf> PartialEq for GenericNCommand<Head, Leaf>
where\n Head: Clone + Display + PartialEq,\n Leaf: Clone + PartialEq + Eq + Display + Hash + PartialEq,

source§

fn eq(&self, other: &GenericNCommand<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","egglog::ast::NCommand"],["
source§

impl<Head, Leaf> Eq for GenericNCommand<Head, Leaf>
where\n Head: Clone + Display + Eq,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Eq,

","Eq","egglog::ast::NCommand"],["
source§

impl<Head, Leaf> StructuralPartialEq for GenericNCommand<Head, Leaf>
where\n Head: Clone + Display,\n Leaf: Clone + PartialEq + Eq + Display + Hash,

","StructuralPartialEq","egglog::ast::NCommand"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/type.impl/egglog/ast/enum.GenericSchedule.js b/docs/type.impl/egglog/ast/enum.GenericSchedule.js new file mode 100644 index 00000000..b56fe253 --- /dev/null +++ b/docs/type.impl/egglog/ast/enum.GenericSchedule.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"egglog":[["
source§

impl<Head: Clone, Leaf: Clone> Clone for GenericSchedule<Head, Leaf>

source§

fn clone(&self) -> GenericSchedule<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","egglog::ast::Schedule"],["
source§

impl<Head: Debug, Leaf: Debug> Debug for GenericSchedule<Head, Leaf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Debug","egglog::ast::Schedule"],["
source§

impl<Head: Display, Leaf: Display> Display for GenericSchedule<Head, Leaf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Display","egglog::ast::Schedule"],["
source§

impl<Head: Hash, Leaf: Hash> Hash for GenericSchedule<Head, Leaf>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","egglog::ast::Schedule"],["
source§

impl<Head: PartialEq, Leaf: PartialEq> PartialEq for GenericSchedule<Head, Leaf>

source§

fn eq(&self, other: &GenericSchedule<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","egglog::ast::Schedule"],["
source§

impl<Head: Display, Leaf: Display> ToSexp for GenericSchedule<Head, Leaf>

source§

fn to_sexp(&self) -> Sexp

","ToSexp","egglog::ast::Schedule"],["
source§

impl<Head: Eq, Leaf: Eq> Eq for GenericSchedule<Head, Leaf>

","Eq","egglog::ast::Schedule"],["
source§

impl<Head, Leaf> StructuralPartialEq for GenericSchedule<Head, Leaf>

","StructuralPartialEq","egglog::ast::Schedule"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/type.impl/egglog/ast/struct.GenericActions.js b/docs/type.impl/egglog/ast/struct.GenericActions.js new file mode 100644 index 00000000..ada39731 --- /dev/null +++ b/docs/type.impl/egglog/ast/struct.GenericActions.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"egglog":[["
source§

impl<Head: Clone + Clone + Display, Leaf: Clone + Clone + PartialEq + Eq + Display + Hash> Clone for GenericActions<Head, Leaf>

source§

fn clone(&self) -> GenericActions<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","egglog::ast::Actions"],["
source§

impl<Head: Debug + Clone + Display, Leaf: Debug + Clone + PartialEq + Eq + Display + Hash> Debug for GenericActions<Head, Leaf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Debug","egglog::ast::Actions"],["
source§

impl<Head, Leaf> Default for GenericActions<Head, Leaf>
where\n Head: Clone + Display,\n Leaf: Clone + PartialEq + Eq + Display + Hash,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
","Default","egglog::ast::Actions"],["
source§

impl<Head, Leaf> GenericActions<Head, Leaf>
where\n Head: Clone + Display,\n Leaf: Clone + PartialEq + Eq + Display + Hash,

source

pub fn new(actions: Vec<GenericAction<Head, Leaf>>) -> Self

source

pub fn singleton(action: GenericAction<Head, Leaf>) -> Self

",0,"egglog::ast::Actions"],["
source§

impl<Head: Hash + Clone + Display, Leaf: Hash + Clone + PartialEq + Eq + Display + Hash> Hash for GenericActions<Head, Leaf>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","egglog::ast::Actions"],["
source§

impl<Head: PartialEq + Clone + Display, Leaf: PartialEq + Clone + PartialEq + Eq + Display + Hash> PartialEq for GenericActions<Head, Leaf>

source§

fn eq(&self, other: &GenericActions<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","egglog::ast::Actions"],["
source§

impl<Head: Eq + Clone + Display, Leaf: Eq + Clone + PartialEq + Eq + Display + Hash> Eq for GenericActions<Head, Leaf>

","Eq","egglog::ast::Actions"],["
source§

impl<Head: Clone + Display, Leaf: Clone + PartialEq + Eq + Display + Hash> StructuralPartialEq for GenericActions<Head, Leaf>

","StructuralPartialEq","egglog::ast::Actions"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/type.impl/egglog/ast/struct.GenericFunctionDecl.js b/docs/type.impl/egglog/ast/struct.GenericFunctionDecl.js new file mode 100644 index 00000000..99cdd0bc --- /dev/null +++ b/docs/type.impl/egglog/ast/struct.GenericFunctionDecl.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"egglog":[["
source§

impl<Head, Leaf> Clone for GenericFunctionDecl<Head, Leaf>
where\n Head: Clone + Display + Clone,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Clone,

source§

fn clone(&self) -> GenericFunctionDecl<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","egglog::ast::FunctionDecl"],["
source§

impl<Head, Leaf> Debug for GenericFunctionDecl<Head, Leaf>
where\n Head: Clone + Display + Debug,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Debug","egglog::ast::FunctionDecl"],["
source§

impl<Head, Leaf> GenericFunctionDecl<Head, Leaf>
where\n Head: Clone + Display,\n Leaf: Clone + PartialEq + Eq + Display + Hash,

source

pub fn visit_exprs(\n self,\n f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>\n) -> GenericFunctionDecl<Head, Leaf>

",0,"egglog::ast::FunctionDecl"],["
source§

impl<Head, Leaf> Hash for GenericFunctionDecl<Head, Leaf>
where\n Head: Clone + Display + Hash,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Hash,

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","egglog::ast::FunctionDecl"],["
source§

impl<Head, Leaf> PartialEq for GenericFunctionDecl<Head, Leaf>
where\n Head: Clone + Display + PartialEq,\n Leaf: Clone + PartialEq + Eq + Display + Hash + PartialEq,

source§

fn eq(&self, other: &GenericFunctionDecl<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","egglog::ast::FunctionDecl"],["
source§

impl<Head, Leaf> ToSexp for GenericFunctionDecl<Head, Leaf>
where\n Head: Clone + Display + ToSexp,\n Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source§

fn to_sexp(&self) -> Sexp

","ToSexp","egglog::ast::FunctionDecl"],["
source§

impl<Head, Leaf> Eq for GenericFunctionDecl<Head, Leaf>
where\n Head: Clone + Display + Eq,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Eq,

","Eq","egglog::ast::FunctionDecl"],["
source§

impl<Head, Leaf> StructuralPartialEq for GenericFunctionDecl<Head, Leaf>
where\n Head: Clone + Display,\n Leaf: Clone + PartialEq + Eq + Display + Hash,

","StructuralPartialEq","egglog::ast::FunctionDecl"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/type.impl/egglog/ast/struct.GenericRewrite.js b/docs/type.impl/egglog/ast/struct.GenericRewrite.js new file mode 100644 index 00000000..419fe2b3 --- /dev/null +++ b/docs/type.impl/egglog/ast/struct.GenericRewrite.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"egglog":[["
source§

impl<Head: Clone, Leaf: Clone> Clone for GenericRewrite<Head, Leaf>

source§

fn clone(&self) -> GenericRewrite<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","egglog::ast::Rewrite"],["
source§

impl<Head: Debug, Leaf: Debug> Debug for GenericRewrite<Head, Leaf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Debug","egglog::ast::Rewrite"],["
source§

impl<Head: Display, Leaf: Display> Display for GenericRewrite<Head, Leaf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Display","egglog::ast::Rewrite"],["
source§

impl<Head: Display, Leaf: Display> GenericRewrite<Head, Leaf>

source

pub fn to_sexp(\n &self,\n ruleset: Symbol,\n is_bidirectional: bool,\n subsume: bool\n) -> Sexp

Converts the rewrite into an s-expression.

\n
",0,"egglog::ast::Rewrite"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/type.impl/egglog/ast/struct.GenericRule.js b/docs/type.impl/egglog/ast/struct.GenericRule.js new file mode 100644 index 00000000..67ca31a0 --- /dev/null +++ b/docs/type.impl/egglog/ast/struct.GenericRule.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"egglog":[["
source§

impl<Head, Leaf> Clone for GenericRule<Head, Leaf>
where\n Head: Clone + Display + Clone,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Clone,

source§

fn clone(&self) -> GenericRule<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","egglog::ast::Rule"],["
source§

impl<Head, Leaf> Debug for GenericRule<Head, Leaf>
where\n Head: Clone + Display + Debug,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Debug","egglog::ast::Rule"],["
source§

impl<Head, Leaf> Display for GenericRule<Head, Leaf>
where\n Head: Clone + Display + ToSexp,\n Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Display","egglog::ast::Rule"],["
source§

impl<Head, Leaf> GenericRule<Head, Leaf>
where\n Head: Clone + Display + ToSexp,\n Leaf: Clone + PartialEq + Eq + Display + Hash + ToSexp,

source

pub fn to_sexp(&self, ruleset: Symbol, name: Symbol) -> Sexp

Converts this rule into an s-expression.

\n
",0,"egglog::ast::Rule"],["
source§

impl<Head, Leaf> Hash for GenericRule<Head, Leaf>
where\n Head: Clone + Display + Hash,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Hash,

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","egglog::ast::Rule"],["
source§

impl<Head, Leaf> PartialEq for GenericRule<Head, Leaf>
where\n Head: Clone + Display + PartialEq,\n Leaf: Clone + PartialEq + Eq + Display + Hash + PartialEq,

source§

fn eq(&self, other: &GenericRule<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","egglog::ast::Rule"],["
source§

impl<Head, Leaf> Eq for GenericRule<Head, Leaf>
where\n Head: Clone + Display + Eq,\n Leaf: Clone + PartialEq + Eq + Display + Hash + Eq,

","Eq","egglog::ast::Rule"],["
source§

impl<Head, Leaf> StructuralPartialEq for GenericRule<Head, Leaf>
where\n Head: Clone + Display,\n Leaf: Clone + PartialEq + Eq + Display + Hash,

","StructuralPartialEq","egglog::ast::Rule"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/type.impl/egglog/ast/struct.GenericRunConfig.js b/docs/type.impl/egglog/ast/struct.GenericRunConfig.js new file mode 100644 index 00000000..4631f7a8 --- /dev/null +++ b/docs/type.impl/egglog/ast/struct.GenericRunConfig.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"egglog":[["
source§

impl<Head: Clone, Leaf: Clone> Clone for GenericRunConfig<Head, Leaf>

source§

fn clone(&self) -> GenericRunConfig<Head, Leaf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","egglog::ast::RunConfig"],["
source§

impl<Head: Debug, Leaf: Debug> Debug for GenericRunConfig<Head, Leaf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Debug","egglog::ast::RunConfig"],["
source§

impl<Head, Leaf> GenericRunConfig<Head, Leaf>
where\n Head: Clone + Display,\n Leaf: Clone + PartialEq + Eq + Display + Hash,

source

pub fn visit_exprs(\n self,\n f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>\n) -> Self

",0,"egglog::ast::RunConfig"],["
source§

impl<Head: Hash, Leaf: Hash> Hash for GenericRunConfig<Head, Leaf>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","egglog::ast::RunConfig"],["
source§

impl<Head: PartialEq, Leaf: PartialEq> PartialEq for GenericRunConfig<Head, Leaf>

source§

fn eq(&self, other: &GenericRunConfig<Head, Leaf>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","egglog::ast::RunConfig"],["
source§

impl<Head, Leaf> ToSexp for GenericRunConfig<Head, Leaf>
where\n Head: Display,\n Leaf: Display,

source§

fn to_sexp(&self) -> Sexp

","ToSexp","egglog::ast::RunConfig"],["
source§

impl<Head: Eq, Leaf: Eq> Eq for GenericRunConfig<Head, Leaf>

","Eq","egglog::ast::RunConfig"],["
source§

impl<Head, Leaf> StructuralPartialEq for GenericRunConfig<Head, Leaf>

","StructuralPartialEq","egglog::ast::RunConfig"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/type.impl/egglog/util/type.IndexMap.js b/docs/type.impl/egglog/util/type.IndexMap.js new file mode 100644 index 00000000..5a6c7514 --- /dev/null +++ b/docs/type.impl/egglog/util/type.IndexMap.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"egglog":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/type.impl/indexmap/map/struct.IndexMap.js b/docs/type.impl/indexmap/map/struct.IndexMap.js new file mode 100644 index 00000000..dbf698cc --- /dev/null +++ b/docs/type.impl/indexmap/map/struct.IndexMap.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"egglog":[["
§

impl<K, V, S> Clone for IndexMap<K, V, S>
where\n K: Clone,\n V: Clone,\n S: Clone,

§

fn clone(&self) -> IndexMap<K, V, S>

Returns a copy of the value. Read more
§

fn clone_from(&mut self, other: &IndexMap<K, V, S>)

Performs copy-assignment from source. Read more
","Clone","egglog::util::IndexMap"],["
§

impl<K, V, S> Debug for IndexMap<K, V, S>
where\n K: Debug,\n V: Debug,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","egglog::util::IndexMap"],["
§

impl<K, V, S> Default for IndexMap<K, V, S>
where\n S: Default,

§

fn default() -> IndexMap<K, V, S>

Return an empty [IndexMap]

\n
","Default","egglog::util::IndexMap"],["
§

impl<'de, K, V, S> Deserialize<'de> for IndexMap<K, V, S>
where\n K: Deserialize<'de> + Eq + Hash,\n V: Deserialize<'de>,\n S: Default + BuildHasher,

§

fn deserialize<D>(\n deserializer: D\n) -> Result<IndexMap<K, V, S>, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","egglog::util::IndexMap"],["
§

impl<'a, K, V, S> Extend<(&'a K, &'a V)> for IndexMap<K, V, S>
where\n K: Hash + Eq + Copy,\n V: Copy,\n S: BuildHasher,

§

fn extend<I>(&mut self, iterable: I)
where\n I: IntoIterator<Item = (&'a K, &'a V)>,

Extend the map with all key-value pairs in the iterable.

\n

See the first extend method for more details.

\n
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<(&'a K, &'a V)>","egglog::util::IndexMap"],["
§

impl<K, V, S> Extend<(K, V)> for IndexMap<K, V, S>
where\n K: Hash + Eq,\n S: BuildHasher,

§

fn extend<I>(&mut self, iterable: I)
where\n I: IntoIterator<Item = (K, V)>,

Extend the map with all key-value pairs in the iterable.

\n

This is equivalent to calling [insert][IndexMap::insert] for each of\nthem in order, which means that for keys that already existed\nin the map, their value is updated but it keeps the existing order.

\n

New keys are inserted in the order they appear in the sequence. If\nequivalents of a key occur more than once, the last corresponding value\nprevails.

\n
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<(K, V)>","egglog::util::IndexMap"],["
§

impl<K, V, S> FromIterator<(K, V)> for IndexMap<K, V, S>
where\n K: Hash + Eq,\n S: BuildHasher + Default,

§

fn from_iter<I>(iterable: I) -> IndexMap<K, V, S>
where\n I: IntoIterator<Item = (K, V)>,

Create an IndexMap from the sequence of key-value pairs in the\niterable.

\n

from_iter uses the same logic as extend. See\n[extend][IndexMap::extend] for more details.

\n
","FromIterator<(K, V)>","egglog::util::IndexMap"],["
§

impl<K, V, Q, S> Index<&Q> for IndexMap<K, V, S>
where\n Q: Hash + Equivalent<K> + ?Sized,\n S: BuildHasher,

Access [IndexMap] values corresponding to a key.

\n

§Examples

\n
use indexmap::IndexMap;\n\nlet mut map = IndexMap::new();\nfor word in \"Lorem ipsum dolor sit amet\".split_whitespace() {\n    map.insert(word.to_lowercase(), word.to_uppercase());\n}\nassert_eq!(map[\"lorem\"], \"LOREM\");\nassert_eq!(map[\"ipsum\"], \"IPSUM\");
\n\n
use indexmap::IndexMap;\n\nlet mut map = IndexMap::new();\nmap.insert(\"foo\", 1);\nprintln!(\"{:?}\", map[\"bar\"]); // panics!
\n
§

fn index(&self, key: &Q) -> &V

Returns a reference to the value corresponding to the supplied key.

\n

Panics if key is not present in the map.

\n
§

type Output = V

The returned type after indexing.
","Index<&Q>","egglog::util::IndexMap"],["
§

impl<K, V, S> Index<(Bound<usize>, Bound<usize>)> for IndexMap<K, V, S>

§

type Output = Slice<K, V>

The returned type after indexing.
§

fn index(\n &self,\n range: (Bound<usize>, Bound<usize>)\n) -> &<IndexMap<K, V, S> as Index<(Bound<usize>, Bound<usize>)>>::Output

Performs the indexing (container[index]) operation. Read more
","Index<(Bound, Bound)>","egglog::util::IndexMap"],["
§

impl<K, V, S> Index<Range<usize>> for IndexMap<K, V, S>

§

type Output = Slice<K, V>

The returned type after indexing.
§

fn index(\n &self,\n range: Range<usize>\n) -> &<IndexMap<K, V, S> as Index<Range<usize>>>::Output

Performs the indexing (container[index]) operation. Read more
","Index>","egglog::util::IndexMap"],["
§

impl<K, V, S> Index<RangeFrom<usize>> for IndexMap<K, V, S>

§

type Output = Slice<K, V>

The returned type after indexing.
§

fn index(\n &self,\n range: RangeFrom<usize>\n) -> &<IndexMap<K, V, S> as Index<RangeFrom<usize>>>::Output

Performs the indexing (container[index]) operation. Read more
","Index>","egglog::util::IndexMap"],["
§

impl<K, V, S> Index<RangeFull> for IndexMap<K, V, S>

§

type Output = Slice<K, V>

The returned type after indexing.
§

fn index(\n &self,\n range: RangeFull\n) -> &<IndexMap<K, V, S> as Index<RangeFull>>::Output

Performs the indexing (container[index]) operation. Read more
","Index","egglog::util::IndexMap"],["
§

impl<K, V, S> Index<RangeInclusive<usize>> for IndexMap<K, V, S>

§

type Output = Slice<K, V>

The returned type after indexing.
§

fn index(\n &self,\n range: RangeInclusive<usize>\n) -> &<IndexMap<K, V, S> as Index<RangeInclusive<usize>>>::Output

Performs the indexing (container[index]) operation. Read more
","Index>","egglog::util::IndexMap"],["
§

impl<K, V, S> Index<RangeTo<usize>> for IndexMap<K, V, S>

§

type Output = Slice<K, V>

The returned type after indexing.
§

fn index(\n &self,\n range: RangeTo<usize>\n) -> &<IndexMap<K, V, S> as Index<RangeTo<usize>>>::Output

Performs the indexing (container[index]) operation. Read more
","Index>","egglog::util::IndexMap"],["
§

impl<K, V, S> Index<RangeToInclusive<usize>> for IndexMap<K, V, S>

§

type Output = Slice<K, V>

The returned type after indexing.
§

fn index(\n &self,\n range: RangeToInclusive<usize>\n) -> &<IndexMap<K, V, S> as Index<RangeToInclusive<usize>>>::Output

Performs the indexing (container[index]) operation. Read more
","Index>","egglog::util::IndexMap"],["
§

impl<K, V, S> Index<usize> for IndexMap<K, V, S>

Access [IndexMap] values at indexed positions.

\n

See Index<usize> for Keys to access a map’s keys instead.

\n

§Examples

\n
use indexmap::IndexMap;\n\nlet mut map = IndexMap::new();\nfor word in \"Lorem ipsum dolor sit amet\".split_whitespace() {\n    map.insert(word.to_lowercase(), word.to_uppercase());\n}\nassert_eq!(map[0], \"LOREM\");\nassert_eq!(map[1], \"IPSUM\");\nmap.reverse();\nassert_eq!(map[0], \"AMET\");\nassert_eq!(map[1], \"SIT\");\nmap.sort_keys();\nassert_eq!(map[0], \"AMET\");\nassert_eq!(map[1], \"DOLOR\");
\n\n
use indexmap::IndexMap;\n\nlet mut map = IndexMap::new();\nmap.insert(\"foo\", 1);\nprintln!(\"{:?}\", map[10]); // panics!
\n
§

fn index(&self, index: usize) -> &V

Returns a reference to the value at the supplied index.

\n

Panics if index is out of bounds.

\n
§

type Output = V

The returned type after indexing.
","Index","egglog::util::IndexMap"],["
§

impl<K, V, S> IndexMap<K, V, S>

pub fn pop(&mut self) -> Option<(K, V)>

Remove the last key-value pair

\n

This preserves the order of the remaining elements.

\n

Computes in O(1) time (average).

\n

pub fn retain<F>(&mut self, keep: F)
where\n F: FnMut(&K, &mut V) -> bool,

Scan through each key-value pair in the map and keep those where the\nclosure keep returns true.

\n

The elements are visited in order, and remaining elements keep their\norder.

\n

Computes in O(n) time (average).

\n

pub fn sort_keys(&mut self)
where\n K: Ord,

Sort the map’s key-value pairs by the default ordering of the keys.

\n

This is a stable sort – but equivalent keys should not normally coexist in\na map at all, so [sort_unstable_keys][Self::sort_unstable_keys] is preferred\nbecause it is generally faster and doesn’t allocate auxiliary memory.

\n

See sort_by for details.

\n

pub fn sort_by<F>(&mut self, cmp: F)
where\n F: FnMut(&K, &V, &K, &V) -> Ordering,

Sort the map’s key-value pairs in place using the comparison\nfunction cmp.

\n

The comparison function receives two key and value pairs to compare (you\ncan sort by keys or values or their combination as needed).

\n

Computes in O(n log n + c) time and O(n) space where n is\nthe length of the map and c the capacity. The sort is stable.

\n

pub fn sorted_by<F>(self, cmp: F) -> IntoIter<K, V>
where\n F: FnMut(&K, &V, &K, &V) -> Ordering,

Sort the key-value pairs of the map and return a by-value iterator of\nthe key-value pairs with the result.

\n

The sort is stable.

\n

pub fn sort_unstable_keys(&mut self)
where\n K: Ord,

Sort the map’s key-value pairs by the default ordering of the keys, but\nmay not preserve the order of equal elements.

\n

See sort_unstable_by for details.

\n

pub fn sort_unstable_by<F>(&mut self, cmp: F)
where\n F: FnMut(&K, &V, &K, &V) -> Ordering,

Sort the map’s key-value pairs in place using the comparison function cmp, but\nmay not preserve the order of equal elements.

\n

The comparison function receives two key and value pairs to compare (you\ncan sort by keys or values or their combination as needed).

\n

Computes in O(n log n + c) time where n is\nthe length of the map and c is the capacity. The sort is unstable.

\n

pub fn sorted_unstable_by<F>(self, cmp: F) -> IntoIter<K, V>
where\n F: FnMut(&K, &V, &K, &V) -> Ordering,

Sort the key-value pairs of the map and return a by-value iterator of\nthe key-value pairs with the result.

\n

The sort is unstable.

\n

pub fn sort_by_cached_key<T, F>(&mut self, sort_key: F)
where\n T: Ord,\n F: FnMut(&K, &V) -> T,

Sort the map’s key-value pairs in place using a sort-key extraction function.

\n

During sorting, the function is called at most once per entry, by using temporary storage\nto remember the results of its evaluation. The order of calls to the function is\nunspecified and may change between versions of indexmap or the standard library.

\n

Computes in O(m n + n log n + c) time () and O(n) space, where the function is\nO(m), n is the length of the map, and c the capacity. The sort is stable.

\n

pub fn binary_search_keys(&self, x: &K) -> Result<usize, usize>
where\n K: Ord,

Search over a sorted map for a key.

\n

Returns the position where that key is present, or the position where it can be inserted to\nmaintain the sort. See slice::binary_search for more details.

\n

Computes in O(log(n)) time, which is notably less scalable than looking the key up\nusing [get_index_of][IndexMap::get_index_of], but this can also position missing keys.

\n

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where\n F: FnMut(&'a K, &'a V) -> Ordering,

Search over a sorted map with a comparator function.

\n

Returns the position where that value is present, or the position where it can be inserted\nto maintain the sort. See slice::binary_search_by for more details.

\n

Computes in O(log(n)) time.

\n

pub fn binary_search_by_key<'a, B, F>(\n &'a self,\n b: &B,\n f: F\n) -> Result<usize, usize>
where\n F: FnMut(&'a K, &'a V) -> B,\n B: Ord,

Search over a sorted map with an extraction function.

\n

Returns the position where that value is present, or the position where it can be inserted\nto maintain the sort. See slice::binary_search_by_key for more details.

\n

Computes in O(log(n)) time.

\n

pub fn partition_point<P>(&self, pred: P) -> usize
where\n P: FnMut(&K, &V) -> bool,

Returns the index of the partition point of a sorted map according to the given predicate\n(the index of the first element of the second partition).

\n

See slice::partition_point for more details.

\n

Computes in O(log(n)) time.

\n

pub fn reverse(&mut self)

Reverses the order of the map’s key-value pairs in place.

\n

Computes in O(n) time and O(1) space.

\n

pub fn as_slice(&self) -> &Slice<K, V>

Returns a slice of all the key-value pairs in the map.

\n

Computes in O(1) time.

\n

pub fn as_mut_slice(&mut self) -> &mut Slice<K, V>

Returns a mutable slice of all the key-value pairs in the map.

\n

Computes in O(1) time.

\n

pub fn into_boxed_slice(self) -> Box<Slice<K, V>>

Converts into a boxed slice of all the key-value pairs in the map.

\n

Note that this will drop the inner hash table and any excess capacity.

\n

pub fn get_index(&self, index: usize) -> Option<(&K, &V)>

Get a key-value pair by index

\n

Valid indices are 0 <= index < self.len().

\n

Computes in O(1) time.

\n

pub fn get_index_mut(&mut self, index: usize) -> Option<(&K, &mut V)>

Get a key-value pair by index

\n

Valid indices are 0 <= index < self.len().

\n

Computes in O(1) time.

\n

pub fn get_index_entry(\n &mut self,\n index: usize\n) -> Option<IndexedEntry<'_, K, V>>

Get an entry in the map by index for in-place manipulation.

\n

Valid indices are 0 <= index < self.len().

\n

Computes in O(1) time.

\n

pub fn get_range<R>(&self, range: R) -> Option<&Slice<K, V>>
where\n R: RangeBounds<usize>,

Returns a slice of key-value pairs in the given range of indices.

\n

Valid indices are 0 <= index < self.len().

\n

Computes in O(1) time.

\n

pub fn get_range_mut<R>(&mut self, range: R) -> Option<&mut Slice<K, V>>
where\n R: RangeBounds<usize>,

Returns a mutable slice of key-value pairs in the given range of indices.

\n

Valid indices are 0 <= index < self.len().

\n

Computes in O(1) time.

\n

pub fn first(&self) -> Option<(&K, &V)>

Get the first key-value pair

\n

Computes in O(1) time.

\n

pub fn first_mut(&mut self) -> Option<(&K, &mut V)>

Get the first key-value pair, with mutable access to the value

\n

Computes in O(1) time.

\n

pub fn first_entry(&mut self) -> Option<IndexedEntry<'_, K, V>>

Get the first entry in the map for in-place manipulation.

\n

Computes in O(1) time.

\n

pub fn last(&self) -> Option<(&K, &V)>

Get the last key-value pair

\n

Computes in O(1) time.

\n

pub fn last_mut(&mut self) -> Option<(&K, &mut V)>

Get the last key-value pair, with mutable access to the value

\n

Computes in O(1) time.

\n

pub fn last_entry(&mut self) -> Option<IndexedEntry<'_, K, V>>

Get the last entry in the map for in-place manipulation.

\n

Computes in O(1) time.

\n

pub fn swap_remove_index(&mut self, index: usize) -> Option<(K, V)>

Remove the key-value pair by index

\n

Valid indices are 0 <= index < self.len().

\n

Like Vec::swap_remove, the pair is removed by swapping it with the\nlast element of the map and popping it off. This perturbs\nthe position of what used to be the last element!

\n

Computes in O(1) time (average).

\n

pub fn shift_remove_index(&mut self, index: usize) -> Option<(K, V)>

Remove the key-value pair by index

\n

Valid indices are 0 <= index < self.len().

\n

Like Vec::remove, the pair is removed by shifting all of the\nelements that follow it, preserving their relative order.\nThis perturbs the index of all of those elements!

\n

Computes in O(n) time (average).

\n

pub fn move_index(&mut self, from: usize, to: usize)

Moves the position of a key-value pair from one index to another\nby shifting all other pairs in-between.

\n
    \n
  • If from < to, the other pairs will shift down while the targeted pair moves up.
  • \n
  • If from > to, the other pairs will shift up while the targeted pair moves down.
  • \n
\n

Panics if from or to are out of bounds.

\n

Computes in O(n) time (average).

\n

pub fn swap_indices(&mut self, a: usize, b: usize)

Swaps the position of two key-value pairs in the map.

\n

Panics if a or b are out of bounds.

\n

Computes in O(1) time (average).

\n
",0,"egglog::util::IndexMap"],["
§

impl<K, V, S> IndexMap<K, V, S>

pub fn with_capacity_and_hasher(n: usize, hash_builder: S) -> IndexMap<K, V, S>

Create a new map with capacity for n key-value pairs. (Does not\nallocate if n is zero.)

\n

Computes in O(n) time.

\n

pub const fn with_hasher(hash_builder: S) -> IndexMap<K, V, S>

Create a new map with hash_builder.

\n

This function is const, so it\ncan be called in static contexts.

\n

pub fn capacity(&self) -> usize

Return the number of elements the map can hold without reallocating.

\n

This number is a lower bound; the map might be able to hold more,\nbut is guaranteed to be able to hold at least this many.

\n

Computes in O(1) time.

\n

pub fn hasher(&self) -> &S

Return a reference to the map’s BuildHasher.

\n

pub fn len(&self) -> usize

Return the number of key-value pairs in the map.

\n

Computes in O(1) time.

\n

pub fn is_empty(&self) -> bool

Returns true if the map contains no elements.

\n

Computes in O(1) time.

\n

pub fn iter(&self) -> Iter<'_, K, V>

Return an iterator over the key-value pairs of the map, in their order

\n

pub fn iter_mut(&mut self) -> IterMut<'_, K, V>

Return an iterator over the key-value pairs of the map, in their order

\n

pub fn keys(&self) -> Keys<'_, K, V>

Return an iterator over the keys of the map, in their order

\n

pub fn into_keys(self) -> IntoKeys<K, V>

Return an owning iterator over the keys of the map, in their order

\n

pub fn values(&self) -> Values<'_, K, V>

Return an iterator over the values of the map, in their order

\n

pub fn values_mut(&mut self) -> ValuesMut<'_, K, V>

Return an iterator over mutable references to the values of the map,\nin their order

\n

pub fn into_values(self) -> IntoValues<K, V>

Return an owning iterator over the values of the map, in their order

\n

pub fn clear(&mut self)

Remove all key-value pairs in the map, while preserving its capacity.

\n

Computes in O(n) time.

\n

pub fn truncate(&mut self, len: usize)

Shortens the map, keeping the first len elements and dropping the rest.

\n

If len is greater than the map’s current length, this has no effect.

\n

pub fn drain<R>(&mut self, range: R) -> Drain<'_, K, V>
where\n R: RangeBounds<usize>,

Clears the IndexMap in the given index range, returning those\nkey-value pairs as a drain iterator.

\n

The range may be any type that implements RangeBounds<usize>,\nincluding all of the std::ops::Range* types, or even a tuple pair of\nBound start and end values. To drain the map entirely, use RangeFull\nlike map.drain(..).

\n

This shifts down all entries following the drained range to fill the\ngap, and keeps the allocated memory for reuse.

\n

Panics if the starting point is greater than the end point or if\nthe end point is greater than the length of the map.

\n

pub fn split_off(&mut self, at: usize) -> IndexMap<K, V, S>
where\n S: Clone,

Splits the collection into two at the given index.

\n

Returns a newly allocated map containing the elements in the range\n[at, len). After the call, the original map will be left containing\nthe elements [0, at) with its previous capacity unchanged.

\n

Panics if at > len.

\n

pub fn reserve(&mut self, additional: usize)

Reserve capacity for additional more key-value pairs.

\n

Computes in O(n) time.

\n

pub fn reserve_exact(&mut self, additional: usize)

Reserve capacity for additional more key-value pairs, without over-allocating.

\n

Unlike reserve, this does not deliberately over-allocate the entry capacity to avoid\nfrequent re-allocations. However, the underlying data structures may still have internal\ncapacity requirements, and the allocator itself may give more space than requested, so this\ncannot be relied upon to be precisely minimal.

\n

Computes in O(n) time.

\n

pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>

Try to reserve capacity for additional more key-value pairs.

\n

Computes in O(n) time.

\n

pub fn try_reserve_exact(\n &mut self,\n additional: usize\n) -> Result<(), TryReserveError>

Try to reserve capacity for additional more key-value pairs, without over-allocating.

\n

Unlike try_reserve, this does not deliberately over-allocate the entry capacity to avoid\nfrequent re-allocations. However, the underlying data structures may still have internal\ncapacity requirements, and the allocator itself may give more space than requested, so this\ncannot be relied upon to be precisely minimal.

\n

Computes in O(n) time.

\n

pub fn shrink_to_fit(&mut self)

Shrink the capacity of the map as much as possible.

\n

Computes in O(n) time.

\n

pub fn shrink_to(&mut self, min_capacity: usize)

Shrink the capacity of the map with a lower limit.

\n

Computes in O(n) time.

\n
",0,"egglog::util::IndexMap"],["
§

impl<K, V, S> IndexMap<K, V, S>
where\n K: Hash + Eq,\n S: BuildHasher,

pub fn insert(&mut self, key: K, value: V) -> Option<V>

Insert a key-value pair in the map.

\n

If an equivalent key already exists in the map: the key remains and\nretains in its place in the order, its corresponding value is updated\nwith value, and the older value is returned inside Some(_).

\n

If no equivalent key existed in the map: the new key-value pair is\ninserted, last in order, and None is returned.

\n

Computes in O(1) time (amortized average).

\n

See also [entry][Self::entry] if you want to insert or modify,\nor [insert_full][Self::insert_full] if you need to get the index of\nthe corresponding key-value pair.

\n

pub fn insert_full(&mut self, key: K, value: V) -> (usize, Option<V>)

Insert a key-value pair in the map, and get their index.

\n

If an equivalent key already exists in the map: the key remains and\nretains in its place in the order, its corresponding value is updated\nwith value, and the older value is returned inside (index, Some(_)).

\n

If no equivalent key existed in the map: the new key-value pair is\ninserted, last in order, and (index, None) is returned.

\n

Computes in O(1) time (amortized average).

\n

See also [entry][Self::entry] if you want to insert or modify.

\n

pub fn insert_sorted(&mut self, key: K, value: V) -> (usize, Option<V>)
where\n K: Ord,

Insert a key-value pair in the map at its ordered position among sorted keys.

\n

This is equivalent to finding the position with\n[binary_search_keys][Self::binary_search_keys], then either updating\nit or calling [insert_before][Self::insert_before] for a new key.

\n

If the sorted key is found in the map, its corresponding value is\nupdated with value, and the older value is returned inside\n(index, Some(_)). Otherwise, the new key-value pair is inserted at\nthe sorted position, and (index, None) is returned.

\n

If the existing keys are not already sorted, then the insertion\nindex is unspecified (like slice::binary_search), but the key-value\npair is moved to or inserted at that position regardless.

\n

Computes in O(n) time (average). Instead of repeating calls to\ninsert_sorted, it may be faster to call batched [insert][Self::insert]\nor [extend][Self::extend] and only call [sort_keys][Self::sort_keys]\nor [sort_unstable_keys][Self::sort_unstable_keys] once.

\n

pub fn insert_before(\n &mut self,\n index: usize,\n key: K,\n value: V\n) -> (usize, Option<V>)

Insert a key-value pair in the map before the entry at the given index, or at the end.

\n

If an equivalent key already exists in the map: the key remains and\nis moved to the new position in the map, its corresponding value is updated\nwith value, and the older value is returned inside Some(_). The returned index\nwill either be the given index or one less, depending on how the entry moved.\n(See shift_insert for different behavior here.)

\n

If no equivalent key existed in the map: the new key-value pair is\ninserted exactly at the given index, and None is returned.

\n

Panics if index is out of bounds.\nValid indices are 0..=map.len() (inclusive).

\n

Computes in O(n) time (average).

\n

See also [entry][Self::entry] if you want to insert or modify,\nperhaps only using the index for new entries with [VacantEntry::shift_insert].

\n
§Examples
\n
use indexmap::IndexMap;\nlet mut map: IndexMap<char, ()> = ('a'..='z').map(|c| (c, ())).collect();\n\n// The new key '*' goes exactly at the given index.\nassert_eq!(map.get_index_of(&'*'), None);\nassert_eq!(map.insert_before(10, '*', ()), (10, None));\nassert_eq!(map.get_index_of(&'*'), Some(10));\n\n// Moving the key 'a' up will shift others down, so this moves *before* 10 to index 9.\nassert_eq!(map.insert_before(10, 'a', ()), (9, Some(())));\nassert_eq!(map.get_index_of(&'a'), Some(9));\nassert_eq!(map.get_index_of(&'*'), Some(10));\n\n// Moving the key 'z' down will shift others up, so this moves to exactly 10.\nassert_eq!(map.insert_before(10, 'z', ()), (10, Some(())));\nassert_eq!(map.get_index_of(&'z'), Some(10));\nassert_eq!(map.get_index_of(&'*'), Some(11));\n\n// Moving or inserting before the endpoint is also valid.\nassert_eq!(map.len(), 27);\nassert_eq!(map.insert_before(map.len(), '*', ()), (26, Some(())));\nassert_eq!(map.get_index_of(&'*'), Some(26));\nassert_eq!(map.insert_before(map.len(), '+', ()), (27, None));\nassert_eq!(map.get_index_of(&'+'), Some(27));\nassert_eq!(map.len(), 28);
\n

pub fn shift_insert(&mut self, index: usize, key: K, value: V) -> Option<V>

Insert a key-value pair in the map at the given index.

\n

If an equivalent key already exists in the map: the key remains and\nis moved to the given index in the map, its corresponding value is updated\nwith value, and the older value is returned inside Some(_).\nNote that existing entries cannot be moved to index == map.len()!\n(See insert_before for different behavior here.)

\n

If no equivalent key existed in the map: the new key-value pair is\ninserted at the given index, and None is returned.

\n

Panics if index is out of bounds.\nValid indices are 0..map.len() (exclusive) when moving an existing entry, or\n0..=map.len() (inclusive) when inserting a new key.

\n

Computes in O(n) time (average).

\n

See also [entry][Self::entry] if you want to insert or modify,\nperhaps only using the index for new entries with [VacantEntry::shift_insert].

\n
§Examples
\n
use indexmap::IndexMap;\nlet mut map: IndexMap<char, ()> = ('a'..='z').map(|c| (c, ())).collect();\n\n// The new key '*' goes exactly at the given index.\nassert_eq!(map.get_index_of(&'*'), None);\nassert_eq!(map.shift_insert(10, '*', ()), None);\nassert_eq!(map.get_index_of(&'*'), Some(10));\n\n// Moving the key 'a' up to 10 will shift others down, including the '*' that was at 10.\nassert_eq!(map.shift_insert(10, 'a', ()), Some(()));\nassert_eq!(map.get_index_of(&'a'), Some(10));\nassert_eq!(map.get_index_of(&'*'), Some(9));\n\n// Moving the key 'z' down to 9 will shift others up, including the '*' that was at 9.\nassert_eq!(map.shift_insert(9, 'z', ()), Some(()));\nassert_eq!(map.get_index_of(&'z'), Some(9));\nassert_eq!(map.get_index_of(&'*'), Some(10));\n\n// Existing keys can move to len-1 at most, but new keys can insert at the endpoint.\nassert_eq!(map.len(), 27);\nassert_eq!(map.shift_insert(map.len() - 1, '*', ()), Some(()));\nassert_eq!(map.get_index_of(&'*'), Some(26));\nassert_eq!(map.shift_insert(map.len(), '+', ()), None);\nassert_eq!(map.get_index_of(&'+'), Some(27));\nassert_eq!(map.len(), 28);
\n\n
use indexmap::IndexMap;\nlet mut map: IndexMap<char, ()> = ('a'..='z').map(|c| (c, ())).collect();\n\n// This is an invalid index for moving an existing key!\nmap.shift_insert(map.len(), 'a', ());
\n

pub fn entry(&mut self, key: K) -> Entry<'_, K, V>

Get the given key’s corresponding entry in the map for insertion and/or\nin-place manipulation.

\n

Computes in O(1) time (amortized average).

\n

pub fn splice<R, I>(\n &mut self,\n range: R,\n replace_with: I\n) -> Splice<'_, <I as IntoIterator>::IntoIter, K, V, S>
where\n R: RangeBounds<usize>,\n I: IntoIterator<Item = (K, V)>,

Creates a splicing iterator that replaces the specified range in the map\nwith the given replace_with key-value iterator and yields the removed\nitems. replace_with does not need to be the same length as range.

\n

The range is removed even if the iterator is not consumed until the\nend. It is unspecified how many elements are removed from the map if the\nSplice value is leaked.

\n

The input iterator replace_with is only consumed when the Splice\nvalue is dropped. If a key from the iterator matches an existing entry\nin the map (outside of range), then the value will be updated in that\nposition. Otherwise, the new key-value pair will be inserted in the\nreplaced range.

\n

Panics if the starting point is greater than the end point or if\nthe end point is greater than the length of the map.

\n
§Examples
\n
use indexmap::IndexMap;\n\nlet mut map = IndexMap::from([(0, '_'), (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd')]);\nlet new = [(5, 'E'), (4, 'D'), (3, 'C'), (2, 'B'), (1, 'A')];\nlet removed: Vec<_> = map.splice(2..4, new).collect();\n\n// 1 and 4 got new values, while 5, 3, and 2 were newly inserted.\nassert!(map.into_iter().eq([(0, '_'), (1, 'A'), (5, 'E'), (3, 'C'), (2, 'B'), (4, 'D')]));\nassert_eq!(removed, &[(2, 'b'), (3, 'c')]);
\n

pub fn append<S2>(&mut self, other: &mut IndexMap<K, V, S2>)

Moves all key-value pairs from other into self, leaving other empty.

\n

This is equivalent to calling [insert][Self::insert] for each\nkey-value pair from other in order, which means that for keys that\nalready exist in self, their value is updated in the current position.

\n
§Examples
\n
use indexmap::IndexMap;\n\n// Note: Key (3) is present in both maps.\nlet mut a = IndexMap::from([(3, \"c\"), (2, \"b\"), (1, \"a\")]);\nlet mut b = IndexMap::from([(3, \"d\"), (4, \"e\"), (5, \"f\")]);\nlet old_capacity = b.capacity();\n\na.append(&mut b);\n\nassert_eq!(a.len(), 5);\nassert_eq!(b.len(), 0);\nassert_eq!(b.capacity(), old_capacity);\n\nassert!(a.keys().eq(&[3, 2, 1, 4, 5]));\nassert_eq!(a[&3], \"d\"); // \"c\" was overwritten.
\n
",0,"egglog::util::IndexMap"],["
§

impl<K, V, S> IndexMap<K, V, S>
where\n S: BuildHasher,

pub fn contains_key<Q>(&self, key: &Q) -> bool
where\n Q: Hash + Equivalent<K> + ?Sized,

Return true if an equivalent to key exists in the map.

\n

Computes in O(1) time (average).

\n

pub fn get<Q>(&self, key: &Q) -> Option<&V>
where\n Q: Hash + Equivalent<K> + ?Sized,

Return a reference to the value stored for key, if it is present,\nelse None.

\n

Computes in O(1) time (average).

\n

pub fn get_key_value<Q>(&self, key: &Q) -> Option<(&K, &V)>
where\n Q: Hash + Equivalent<K> + ?Sized,

Return references to the key-value pair stored for key,\nif it is present, else None.

\n

Computes in O(1) time (average).

\n

pub fn get_full<Q>(&self, key: &Q) -> Option<(usize, &K, &V)>
where\n Q: Hash + Equivalent<K> + ?Sized,

Return item index, key and value

\n

pub fn get_index_of<Q>(&self, key: &Q) -> Option<usize>
where\n Q: Hash + Equivalent<K> + ?Sized,

Return item index, if it exists in the map

\n

Computes in O(1) time (average).

\n

pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
where\n Q: Hash + Equivalent<K> + ?Sized,

pub fn get_full_mut<Q>(&mut self, key: &Q) -> Option<(usize, &K, &mut V)>
where\n Q: Hash + Equivalent<K> + ?Sized,

pub fn remove<Q>(&mut self, key: &Q) -> Option<V>
where\n Q: Hash + Equivalent<K> + ?Sized,

👎Deprecated: remove disrupts the map order – use swap_remove or shift_remove for explicit behavior.

Remove the key-value pair equivalent to key and return\nits value.

\n

NOTE: This is equivalent to [.swap_remove(key)][Self::swap_remove], replacing this\nentry’s position with the last element, and it is deprecated in favor of calling that\nexplicitly. If you need to preserve the relative order of the keys in the map, use\n[.shift_remove(key)][Self::shift_remove] instead.

\n

pub fn remove_entry<Q>(&mut self, key: &Q) -> Option<(K, V)>
where\n Q: Hash + Equivalent<K> + ?Sized,

👎Deprecated: remove_entry disrupts the map order – use swap_remove_entry or shift_remove_entry for explicit behavior.

Remove and return the key-value pair equivalent to key.

\n

NOTE: This is equivalent to [.swap_remove_entry(key)][Self::swap_remove_entry],\nreplacing this entry’s position with the last element, and it is deprecated in favor of\ncalling that explicitly. If you need to preserve the relative order of the keys in the map,\nuse [.shift_remove_entry(key)][Self::shift_remove_entry] instead.

\n

pub fn swap_remove<Q>(&mut self, key: &Q) -> Option<V>
where\n Q: Hash + Equivalent<K> + ?Sized,

Remove the key-value pair equivalent to key and return\nits value.

\n

Like Vec::swap_remove, the pair is removed by swapping it with the\nlast element of the map and popping it off. This perturbs\nthe position of what used to be the last element!

\n

Return None if key is not in map.

\n

Computes in O(1) time (average).

\n

pub fn swap_remove_entry<Q>(&mut self, key: &Q) -> Option<(K, V)>
where\n Q: Hash + Equivalent<K> + ?Sized,

Remove and return the key-value pair equivalent to key.

\n

Like Vec::swap_remove, the pair is removed by swapping it with the\nlast element of the map and popping it off. This perturbs\nthe position of what used to be the last element!

\n

Return None if key is not in map.

\n

Computes in O(1) time (average).

\n

pub fn swap_remove_full<Q>(&mut self, key: &Q) -> Option<(usize, K, V)>
where\n Q: Hash + Equivalent<K> + ?Sized,

Remove the key-value pair equivalent to key and return it and\nthe index it had.

\n

Like Vec::swap_remove, the pair is removed by swapping it with the\nlast element of the map and popping it off. This perturbs\nthe position of what used to be the last element!

\n

Return None if key is not in map.

\n

Computes in O(1) time (average).

\n

pub fn shift_remove<Q>(&mut self, key: &Q) -> Option<V>
where\n Q: Hash + Equivalent<K> + ?Sized,

Remove the key-value pair equivalent to key and return\nits value.

\n

Like Vec::remove, the pair is removed by shifting all of the\nelements that follow it, preserving their relative order.\nThis perturbs the index of all of those elements!

\n

Return None if key is not in map.

\n

Computes in O(n) time (average).

\n

pub fn shift_remove_entry<Q>(&mut self, key: &Q) -> Option<(K, V)>
where\n Q: Hash + Equivalent<K> + ?Sized,

Remove and return the key-value pair equivalent to key.

\n

Like Vec::remove, the pair is removed by shifting all of the\nelements that follow it, preserving their relative order.\nThis perturbs the index of all of those elements!

\n

Return None if key is not in map.

\n

Computes in O(n) time (average).

\n

pub fn shift_remove_full<Q>(&mut self, key: &Q) -> Option<(usize, K, V)>
where\n Q: Hash + Equivalent<K> + ?Sized,

Remove the key-value pair equivalent to key and return it and\nthe index it had.

\n

Like Vec::remove, the pair is removed by shifting all of the\nelements that follow it, preserving their relative order.\nThis perturbs the index of all of those elements!

\n

Return None if key is not in map.

\n

Computes in O(n) time (average).

\n
",0,"egglog::util::IndexMap"],["
§

impl<K, V, Q, S> IndexMut<&Q> for IndexMap<K, V, S>
where\n Q: Hash + Equivalent<K> + ?Sized,\n S: BuildHasher,

Access [IndexMap] values corresponding to a key.

\n

Mutable indexing allows changing / updating values of key-value\npairs that are already present.

\n

You can not insert new pairs with index syntax, use .insert().

\n

§Examples

\n
use indexmap::IndexMap;\n\nlet mut map = IndexMap::new();\nfor word in \"Lorem ipsum dolor sit amet\".split_whitespace() {\n    map.insert(word.to_lowercase(), word.to_string());\n}\nlet lorem = &mut map[\"lorem\"];\nassert_eq!(lorem, \"Lorem\");\nlorem.retain(char::is_lowercase);\nassert_eq!(map[\"lorem\"], \"orem\");
\n\n
use indexmap::IndexMap;\n\nlet mut map = IndexMap::new();\nmap.insert(\"foo\", 1);\nmap[\"bar\"] = 1; // panics!
\n
§

fn index_mut(&mut self, key: &Q) -> &mut V

Returns a mutable reference to the value corresponding to the supplied key.

\n

Panics if key is not present in the map.

\n
","IndexMut<&Q>","egglog::util::IndexMap"],["
§

impl<K, V, S> IndexMut<(Bound<usize>, Bound<usize>)> for IndexMap<K, V, S>

§

fn index_mut(\n &mut self,\n range: (Bound<usize>, Bound<usize>)\n) -> &mut <IndexMap<K, V, S> as Index<(Bound<usize>, Bound<usize>)>>::Output

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut<(Bound, Bound)>","egglog::util::IndexMap"],["
§

impl<K, V, S> IndexMut<Range<usize>> for IndexMap<K, V, S>

§

fn index_mut(\n &mut self,\n range: Range<usize>\n) -> &mut <IndexMap<K, V, S> as Index<Range<usize>>>::Output

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut>","egglog::util::IndexMap"],["
§

impl<K, V, S> IndexMut<RangeFrom<usize>> for IndexMap<K, V, S>

§

fn index_mut(\n &mut self,\n range: RangeFrom<usize>\n) -> &mut <IndexMap<K, V, S> as Index<RangeFrom<usize>>>::Output

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut>","egglog::util::IndexMap"],["
§

impl<K, V, S> IndexMut<RangeFull> for IndexMap<K, V, S>

§

fn index_mut(\n &mut self,\n range: RangeFull\n) -> &mut <IndexMap<K, V, S> as Index<RangeFull>>::Output

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","egglog::util::IndexMap"],["
§

impl<K, V, S> IndexMut<RangeInclusive<usize>> for IndexMap<K, V, S>

§

fn index_mut(\n &mut self,\n range: RangeInclusive<usize>\n) -> &mut <IndexMap<K, V, S> as Index<RangeInclusive<usize>>>::Output

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut>","egglog::util::IndexMap"],["
§

impl<K, V, S> IndexMut<RangeTo<usize>> for IndexMap<K, V, S>

§

fn index_mut(\n &mut self,\n range: RangeTo<usize>\n) -> &mut <IndexMap<K, V, S> as Index<RangeTo<usize>>>::Output

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut>","egglog::util::IndexMap"],["
§

impl<K, V, S> IndexMut<RangeToInclusive<usize>> for IndexMap<K, V, S>

§

fn index_mut(\n &mut self,\n range: RangeToInclusive<usize>\n) -> &mut <IndexMap<K, V, S> as Index<RangeToInclusive<usize>>>::Output

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut>","egglog::util::IndexMap"],["
§

impl<K, V, S> IndexMut<usize> for IndexMap<K, V, S>

Access [IndexMap] values at indexed positions.

\n

Mutable indexing allows changing / updating indexed values\nthat are already present.

\n

You can not insert new values with index syntax – use [.insert()][IndexMap::insert].

\n

§Examples

\n
use indexmap::IndexMap;\n\nlet mut map = IndexMap::new();\nfor word in \"Lorem ipsum dolor sit amet\".split_whitespace() {\n    map.insert(word.to_lowercase(), word.to_string());\n}\nlet lorem = &mut map[0];\nassert_eq!(lorem, \"Lorem\");\nlorem.retain(char::is_lowercase);\nassert_eq!(map[\"lorem\"], \"orem\");
\n\n
use indexmap::IndexMap;\n\nlet mut map = IndexMap::new();\nmap.insert(\"foo\", 1);\nmap[10] = 1; // panics!
\n
§

fn index_mut(&mut self, index: usize) -> &mut V

Returns a mutable reference to the value at the supplied index.

\n

Panics if index is out of bounds.

\n
","IndexMut","egglog::util::IndexMap"],["
§

impl<'de, K, V, S, E> IntoDeserializer<'de, E> for IndexMap<K, V, S>
where\n K: IntoDeserializer<'de, E> + Eq + Hash,\n V: IntoDeserializer<'de, E>,\n S: BuildHasher,\n E: Error,

§

type Deserializer = MapDeserializer<'de, <IndexMap<K, V, S> as IntoIterator>::IntoIter, E>

The type of the deserializer being converted into.
§

fn into_deserializer(\n self\n) -> <IndexMap<K, V, S> as IntoDeserializer<'de, E>>::Deserializer

Convert this value into a deserializer.
","IntoDeserializer<'de, E>","egglog::util::IndexMap"],["
§

impl<K, V, S> IntoIterator for IndexMap<K, V, S>

§

type Item = (K, V)

The type of the elements being iterated over.
§

type IntoIter = IntoIter<K, V>

Which kind of iterator are we turning this into?
§

fn into_iter(self) -> <IndexMap<K, V, S> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
","IntoIterator","egglog::util::IndexMap"],["
§

impl<K, V, S> MutableKeys for IndexMap<K, V, S>
where\n S: BuildHasher,

Opt-in mutable access to [IndexMap] keys.

\n

See [MutableKeys] for more information.

\n
§

type Key = K

§

type Value = V

§

fn get_full_mut2<Q>(&mut self, key: &Q) -> Option<(usize, &mut K, &mut V)>
where\n Q: Hash + Equivalent<K> + ?Sized,

Return item index, mutable reference to key and value Read more
§

fn get_index_mut2(&mut self, index: usize) -> Option<(&mut K, &mut V)>

Return mutable reference to key and value at an index. Read more
§

fn iter_mut2(\n &mut self\n) -> IterMut2<'_, <IndexMap<K, V, S> as MutableKeys>::Key, <IndexMap<K, V, S> as MutableKeys>::Value>

Return an iterator over the key-value pairs of the map, in their order
§

fn retain2<F>(&mut self, keep: F)
where\n F: FnMut(&mut K, &mut V) -> bool,

Scan through each key-value pair in the map and keep those where the\nclosure keep returns true. Read more
","MutableKeys","egglog::util::IndexMap"],["
§

impl<K, V1, S1, V2, S2> PartialEq<IndexMap<K, V2, S2>> for IndexMap<K, V1, S1>
where\n K: Hash + Eq,\n V1: PartialEq<V2>,\n S1: BuildHasher,\n S2: BuildHasher,

§

fn eq(&self, other: &IndexMap<K, V2, S2>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq>","egglog::util::IndexMap"],["
§

impl<K, V, S> RawEntryApiV1<K, V, S> for IndexMap<K, V, S>

§

fn raw_entry_v1(&self) -> RawEntryBuilder<'_, K, V, S>

Creates a raw immutable entry builder for the [IndexMap]. Read more
§

fn raw_entry_mut_v1(&mut self) -> RawEntryBuilderMut<'_, K, V, S>

Creates a raw entry builder for the [IndexMap]. Read more
","RawEntryApiV1","egglog::util::IndexMap"],["
§

impl<K, V, S> Serialize for IndexMap<K, V, S>
where\n K: Serialize,\n V: Serialize,

§

fn serialize<T>(\n &self,\n serializer: T\n) -> Result<<T as Serializer>::Ok, <T as Serializer>::Error>
where\n T: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","egglog::util::IndexMap"],["
§

impl<K, V, S> Eq for IndexMap<K, V, S>
where\n K: Eq + Hash,\n V: Eq,\n S: BuildHasher,

","Eq","egglog::util::IndexMap"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/type.impl/indexmap/set/struct.IndexSet.js b/docs/type.impl/indexmap/set/struct.IndexSet.js new file mode 100644 index 00000000..067f8330 --- /dev/null +++ b/docs/type.impl/indexmap/set/struct.IndexSet.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"egglog":[["
§

impl<T, S> Clone for IndexSet<T, S>
where\n T: Clone,\n S: Clone,

§

fn clone(&self) -> IndexSet<T, S>

Returns a copy of the value. Read more
§

fn clone_from(&mut self, other: &IndexSet<T, S>)

Performs copy-assignment from source. Read more
","Clone","egglog::util::IndexSet"],["
§

impl<T, S> Debug for IndexSet<T, S>
where\n T: Debug,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","egglog::util::IndexSet"],["
§

impl<T, S> Default for IndexSet<T, S>
where\n S: Default,

§

fn default() -> IndexSet<T, S>

Return an empty [IndexSet]

\n
","Default","egglog::util::IndexSet"],["
§

impl<'de, T, S> Deserialize<'de> for IndexSet<T, S>
where\n T: Deserialize<'de> + Eq + Hash,\n S: Default + BuildHasher,

§

fn deserialize<D>(\n deserializer: D\n) -> Result<IndexSet<T, S>, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","egglog::util::IndexSet"],["
§

impl<'a, T, S> Extend<&'a T> for IndexSet<T, S>
where\n T: Hash + Eq + Copy + 'a,\n S: BuildHasher,

§

fn extend<I>(&mut self, iterable: I)
where\n I: IntoIterator<Item = &'a T>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<&'a T>","egglog::util::IndexSet"],["
§

impl<T, S> Extend<T> for IndexSet<T, S>
where\n T: Hash + Eq,\n S: BuildHasher,

§

fn extend<I>(&mut self, iterable: I)
where\n I: IntoIterator<Item = T>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend","egglog::util::IndexSet"],["
§

impl<T, S> FromIterator<T> for IndexSet<T, S>
where\n T: Hash + Eq,\n S: BuildHasher + Default,

§

fn from_iter<I>(iterable: I) -> IndexSet<T, S>
where\n I: IntoIterator<Item = T>,

Creates a value from an iterator. Read more
","FromIterator","egglog::util::IndexSet"],["
§

impl<T, S> Index<(Bound<usize>, Bound<usize>)> for IndexSet<T, S>

§

type Output = Slice<T>

The returned type after indexing.
§

fn index(\n &self,\n range: (Bound<usize>, Bound<usize>)\n) -> &<IndexSet<T, S> as Index<(Bound<usize>, Bound<usize>)>>::Output

Performs the indexing (container[index]) operation. Read more
","Index<(Bound, Bound)>","egglog::util::IndexSet"],["
§

impl<T, S> Index<Range<usize>> for IndexSet<T, S>

§

type Output = Slice<T>

The returned type after indexing.
§

fn index(\n &self,\n range: Range<usize>\n) -> &<IndexSet<T, S> as Index<Range<usize>>>::Output

Performs the indexing (container[index]) operation. Read more
","Index>","egglog::util::IndexSet"],["
§

impl<T, S> Index<RangeFrom<usize>> for IndexSet<T, S>

§

type Output = Slice<T>

The returned type after indexing.
§

fn index(\n &self,\n range: RangeFrom<usize>\n) -> &<IndexSet<T, S> as Index<RangeFrom<usize>>>::Output

Performs the indexing (container[index]) operation. Read more
","Index>","egglog::util::IndexSet"],["
§

impl<T, S> Index<RangeFull> for IndexSet<T, S>

§

type Output = Slice<T>

The returned type after indexing.
§

fn index(\n &self,\n range: RangeFull\n) -> &<IndexSet<T, S> as Index<RangeFull>>::Output

Performs the indexing (container[index]) operation. Read more
","Index","egglog::util::IndexSet"],["
§

impl<T, S> Index<RangeInclusive<usize>> for IndexSet<T, S>

§

type Output = Slice<T>

The returned type after indexing.
§

fn index(\n &self,\n range: RangeInclusive<usize>\n) -> &<IndexSet<T, S> as Index<RangeInclusive<usize>>>::Output

Performs the indexing (container[index]) operation. Read more
","Index>","egglog::util::IndexSet"],["
§

impl<T, S> Index<RangeTo<usize>> for IndexSet<T, S>

§

type Output = Slice<T>

The returned type after indexing.
§

fn index(\n &self,\n range: RangeTo<usize>\n) -> &<IndexSet<T, S> as Index<RangeTo<usize>>>::Output

Performs the indexing (container[index]) operation. Read more
","Index>","egglog::util::IndexSet"],["
§

impl<T, S> Index<RangeToInclusive<usize>> for IndexSet<T, S>

§

type Output = Slice<T>

The returned type after indexing.
§

fn index(\n &self,\n range: RangeToInclusive<usize>\n) -> &<IndexSet<T, S> as Index<RangeToInclusive<usize>>>::Output

Performs the indexing (container[index]) operation. Read more
","Index>","egglog::util::IndexSet"],["
§

impl<T, S> Index<usize> for IndexSet<T, S>

Access [IndexSet] values at indexed positions.

\n

§Examples

\n
use indexmap::IndexSet;\n\nlet mut set = IndexSet::new();\nfor word in \"Lorem ipsum dolor sit amet\".split_whitespace() {\n    set.insert(word.to_string());\n}\nassert_eq!(set[0], \"Lorem\");\nassert_eq!(set[1], \"ipsum\");\nset.reverse();\nassert_eq!(set[0], \"amet\");\nassert_eq!(set[1], \"sit\");\nset.sort();\nassert_eq!(set[0], \"Lorem\");\nassert_eq!(set[1], \"amet\");
\n\n
use indexmap::IndexSet;\n\nlet mut set = IndexSet::new();\nset.insert(\"foo\");\nprintln!(\"{:?}\", set[10]); // panics!
\n
§

fn index(&self, index: usize) -> &T

Returns a reference to the value at the supplied index.

\n

Panics if index is out of bounds.

\n
§

type Output = T

The returned type after indexing.
","Index","egglog::util::IndexSet"],["
§

impl<T, S> IndexSet<T, S>

pub fn pop(&mut self) -> Option<T>

Remove the last value

\n

This preserves the order of the remaining elements.

\n

Computes in O(1) time (average).

\n

pub fn retain<F>(&mut self, keep: F)
where\n F: FnMut(&T) -> bool,

Scan through each value in the set and keep those where the\nclosure keep returns true.

\n

The elements are visited in order, and remaining elements keep their\norder.

\n

Computes in O(n) time (average).

\n

pub fn sort(&mut self)
where\n T: Ord,

Sort the set’s values by their default ordering.

\n

This is a stable sort – but equivalent values should not normally coexist in\na set at all, so [sort_unstable][Self::sort_unstable] is preferred\nbecause it is generally faster and doesn’t allocate auxiliary memory.

\n

See sort_by for details.

\n

pub fn sort_by<F>(&mut self, cmp: F)
where\n F: FnMut(&T, &T) -> Ordering,

Sort the set’s values in place using the comparison function cmp.

\n

Computes in O(n log n) time and O(n) space. The sort is stable.

\n

pub fn sorted_by<F>(self, cmp: F) -> IntoIter<T>
where\n F: FnMut(&T, &T) -> Ordering,

Sort the values of the set and return a by-value iterator of\nthe values with the result.

\n

The sort is stable.

\n

pub fn sort_unstable(&mut self)
where\n T: Ord,

Sort the set’s values by their default ordering.

\n

See sort_unstable_by for details.

\n

pub fn sort_unstable_by<F>(&mut self, cmp: F)
where\n F: FnMut(&T, &T) -> Ordering,

Sort the set’s values in place using the comparison function cmp.

\n

Computes in O(n log n) time. The sort is unstable.

\n

pub fn sorted_unstable_by<F>(self, cmp: F) -> IntoIter<T>
where\n F: FnMut(&T, &T) -> Ordering,

Sort the values of the set and return a by-value iterator of\nthe values with the result.

\n

pub fn sort_by_cached_key<K, F>(&mut self, sort_key: F)
where\n K: Ord,\n F: FnMut(&T) -> K,

Sort the set’s values in place using a key extraction function.

\n

During sorting, the function is called at most once per entry, by using temporary storage\nto remember the results of its evaluation. The order of calls to the function is\nunspecified and may change between versions of indexmap or the standard library.

\n

Computes in O(m n + n log n + c) time () and O(n) space, where the function is\nO(m), n is the length of the map, and c the capacity. The sort is stable.

\n

pub fn binary_search(&self, x: &T) -> Result<usize, usize>
where\n T: Ord,

Search over a sorted set for a value.

\n

Returns the position where that value is present, or the position where it can be inserted\nto maintain the sort. See slice::binary_search for more details.

\n

Computes in O(log(n)) time, which is notably less scalable than looking the value up\nusing [get_index_of][IndexSet::get_index_of], but this can also position missing values.

\n

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where\n F: FnMut(&'a T) -> Ordering,

Search over a sorted set with a comparator function.

\n

Returns the position where that value is present, or the position where it can be inserted\nto maintain the sort. See slice::binary_search_by for more details.

\n

Computes in O(log(n)) time.

\n

pub fn binary_search_by_key<'a, B, F>(\n &'a self,\n b: &B,\n f: F\n) -> Result<usize, usize>
where\n F: FnMut(&'a T) -> B,\n B: Ord,

Search over a sorted set with an extraction function.

\n

Returns the position where that value is present, or the position where it can be inserted\nto maintain the sort. See slice::binary_search_by_key for more details.

\n

Computes in O(log(n)) time.

\n

pub fn partition_point<P>(&self, pred: P) -> usize
where\n P: FnMut(&T) -> bool,

Returns the index of the partition point of a sorted set according to the given predicate\n(the index of the first element of the second partition).

\n

See slice::partition_point for more details.

\n

Computes in O(log(n)) time.

\n

pub fn reverse(&mut self)

Reverses the order of the set’s values in place.

\n

Computes in O(n) time and O(1) space.

\n

pub fn as_slice(&self) -> &Slice<T>

Returns a slice of all the values in the set.

\n

Computes in O(1) time.

\n

pub fn into_boxed_slice(self) -> Box<Slice<T>>

Converts into a boxed slice of all the values in the set.

\n

Note that this will drop the inner hash table and any excess capacity.

\n

pub fn get_index(&self, index: usize) -> Option<&T>

Get a value by index

\n

Valid indices are 0 <= index < self.len().

\n

Computes in O(1) time.

\n

pub fn get_range<R>(&self, range: R) -> Option<&Slice<T>>
where\n R: RangeBounds<usize>,

Returns a slice of values in the given range of indices.

\n

Valid indices are 0 <= index < self.len().

\n

Computes in O(1) time.

\n

pub fn first(&self) -> Option<&T>

Get the first value

\n

Computes in O(1) time.

\n

pub fn last(&self) -> Option<&T>

Get the last value

\n

Computes in O(1) time.

\n

pub fn swap_remove_index(&mut self, index: usize) -> Option<T>

Remove the value by index

\n

Valid indices are 0 <= index < self.len().

\n

Like Vec::swap_remove, the value is removed by swapping it with the\nlast element of the set and popping it off. This perturbs\nthe position of what used to be the last element!

\n

Computes in O(1) time (average).

\n

pub fn shift_remove_index(&mut self, index: usize) -> Option<T>

Remove the value by index

\n

Valid indices are 0 <= index < self.len().

\n

Like Vec::remove, the value is removed by shifting all of the\nelements that follow it, preserving their relative order.\nThis perturbs the index of all of those elements!

\n

Computes in O(n) time (average).

\n

pub fn move_index(&mut self, from: usize, to: usize)

Moves the position of a value from one index to another\nby shifting all other values in-between.

\n
    \n
  • If from < to, the other values will shift down while the targeted value moves up.
  • \n
  • If from > to, the other values will shift up while the targeted value moves down.
  • \n
\n

Panics if from or to are out of bounds.

\n

Computes in O(n) time (average).

\n

pub fn swap_indices(&mut self, a: usize, b: usize)

Swaps the position of two values in the set.

\n

Panics if a or b are out of bounds.

\n

Computes in O(1) time (average).

\n
",0,"egglog::util::IndexSet"],["
§

impl<T, S> IndexSet<T, S>

pub fn with_capacity_and_hasher(n: usize, hash_builder: S) -> IndexSet<T, S>

Create a new set with capacity for n elements.\n(Does not allocate if n is zero.)

\n

Computes in O(n) time.

\n

pub const fn with_hasher(hash_builder: S) -> IndexSet<T, S>

Create a new set with hash_builder.

\n

This function is const, so it\ncan be called in static contexts.

\n

pub fn capacity(&self) -> usize

Return the number of elements the set can hold without reallocating.

\n

This number is a lower bound; the set might be able to hold more,\nbut is guaranteed to be able to hold at least this many.

\n

Computes in O(1) time.

\n

pub fn hasher(&self) -> &S

Return a reference to the set’s BuildHasher.

\n

pub fn len(&self) -> usize

Return the number of elements in the set.

\n

Computes in O(1) time.

\n

pub fn is_empty(&self) -> bool

Returns true if the set contains no elements.

\n

Computes in O(1) time.

\n

pub fn iter(&self) -> Iter<'_, T>

Return an iterator over the values of the set, in their order

\n

pub fn clear(&mut self)

Remove all elements in the set, while preserving its capacity.

\n

Computes in O(n) time.

\n

pub fn truncate(&mut self, len: usize)

Shortens the set, keeping the first len elements and dropping the rest.

\n

If len is greater than the set’s current length, this has no effect.

\n

pub fn drain<R>(&mut self, range: R) -> Drain<'_, T>
where\n R: RangeBounds<usize>,

Clears the IndexSet in the given index range, returning those values\nas a drain iterator.

\n

The range may be any type that implements RangeBounds<usize>,\nincluding all of the std::ops::Range* types, or even a tuple pair of\nBound start and end values. To drain the set entirely, use RangeFull\nlike set.drain(..).

\n

This shifts down all entries following the drained range to fill the\ngap, and keeps the allocated memory for reuse.

\n

Panics if the starting point is greater than the end point or if\nthe end point is greater than the length of the set.

\n

pub fn split_off(&mut self, at: usize) -> IndexSet<T, S>
where\n S: Clone,

Splits the collection into two at the given index.

\n

Returns a newly allocated set containing the elements in the range\n[at, len). After the call, the original set will be left containing\nthe elements [0, at) with its previous capacity unchanged.

\n

Panics if at > len.

\n

pub fn reserve(&mut self, additional: usize)

Reserve capacity for additional more values.

\n

Computes in O(n) time.

\n

pub fn reserve_exact(&mut self, additional: usize)

Reserve capacity for additional more values, without over-allocating.

\n

Unlike reserve, this does not deliberately over-allocate the entry capacity to avoid\nfrequent re-allocations. However, the underlying data structures may still have internal\ncapacity requirements, and the allocator itself may give more space than requested, so this\ncannot be relied upon to be precisely minimal.

\n

Computes in O(n) time.

\n

pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>

Try to reserve capacity for additional more values.

\n

Computes in O(n) time.

\n

pub fn try_reserve_exact(\n &mut self,\n additional: usize\n) -> Result<(), TryReserveError>

Try to reserve capacity for additional more values, without over-allocating.

\n

Unlike try_reserve, this does not deliberately over-allocate the entry capacity to avoid\nfrequent re-allocations. However, the underlying data structures may still have internal\ncapacity requirements, and the allocator itself may give more space than requested, so this\ncannot be relied upon to be precisely minimal.

\n

Computes in O(n) time.

\n

pub fn shrink_to_fit(&mut self)

Shrink the capacity of the set as much as possible.

\n

Computes in O(n) time.

\n

pub fn shrink_to(&mut self, min_capacity: usize)

Shrink the capacity of the set with a lower limit.

\n

Computes in O(n) time.

\n
",0,"egglog::util::IndexSet"],["
§

impl<T, S> IndexSet<T, S>
where\n S: BuildHasher,

pub fn contains<Q>(&self, value: &Q) -> bool
where\n Q: Hash + Equivalent<T> + ?Sized,

Return true if an equivalent to value exists in the set.

\n

Computes in O(1) time (average).

\n

pub fn get<Q>(&self, value: &Q) -> Option<&T>
where\n Q: Hash + Equivalent<T> + ?Sized,

Return a reference to the value stored in the set, if it is present,\nelse None.

\n

Computes in O(1) time (average).

\n

pub fn get_full<Q>(&self, value: &Q) -> Option<(usize, &T)>
where\n Q: Hash + Equivalent<T> + ?Sized,

Return item index and value

\n

pub fn get_index_of<Q>(&self, value: &Q) -> Option<usize>
where\n Q: Hash + Equivalent<T> + ?Sized,

Return item index, if it exists in the set

\n

Computes in O(1) time (average).

\n

pub fn remove<Q>(&mut self, value: &Q) -> bool
where\n Q: Hash + Equivalent<T> + ?Sized,

👎Deprecated: remove disrupts the set order – use swap_remove or shift_remove for explicit behavior.

Remove the value from the set, and return true if it was present.

\n

NOTE: This is equivalent to [.swap_remove(value)][Self::swap_remove], replacing this\nvalue’s position with the last element, and it is deprecated in favor of calling that\nexplicitly. If you need to preserve the relative order of the values in the set, use\n[.shift_remove(value)][Self::shift_remove] instead.

\n

pub fn swap_remove<Q>(&mut self, value: &Q) -> bool
where\n Q: Hash + Equivalent<T> + ?Sized,

Remove the value from the set, and return true if it was present.

\n

Like Vec::swap_remove, the value is removed by swapping it with the\nlast element of the set and popping it off. This perturbs\nthe position of what used to be the last element!

\n

Return false if value was not in the set.

\n

Computes in O(1) time (average).

\n

pub fn shift_remove<Q>(&mut self, value: &Q) -> bool
where\n Q: Hash + Equivalent<T> + ?Sized,

Remove the value from the set, and return true if it was present.

\n

Like Vec::remove, the value is removed by shifting all of the\nelements that follow it, preserving their relative order.\nThis perturbs the index of all of those elements!

\n

Return false if value was not in the set.

\n

Computes in O(n) time (average).

\n

pub fn take<Q>(&mut self, value: &Q) -> Option<T>
where\n Q: Hash + Equivalent<T> + ?Sized,

👎Deprecated: take disrupts the set order – use swap_take or shift_take for explicit behavior.

Removes and returns the value in the set, if any, that is equal to the\ngiven one.

\n

NOTE: This is equivalent to [.swap_take(value)][Self::swap_take], replacing this\nvalue’s position with the last element, and it is deprecated in favor of calling that\nexplicitly. If you need to preserve the relative order of the values in the set, use\n[.shift_take(value)][Self::shift_take] instead.

\n

pub fn swap_take<Q>(&mut self, value: &Q) -> Option<T>
where\n Q: Hash + Equivalent<T> + ?Sized,

Removes and returns the value in the set, if any, that is equal to the\ngiven one.

\n

Like Vec::swap_remove, the value is removed by swapping it with the\nlast element of the set and popping it off. This perturbs\nthe position of what used to be the last element!

\n

Return None if value was not in the set.

\n

Computes in O(1) time (average).

\n

pub fn shift_take<Q>(&mut self, value: &Q) -> Option<T>
where\n Q: Hash + Equivalent<T> + ?Sized,

Removes and returns the value in the set, if any, that is equal to the\ngiven one.

\n

Like Vec::remove, the value is removed by shifting all of the\nelements that follow it, preserving their relative order.\nThis perturbs the index of all of those elements!

\n

Return None if value was not in the set.

\n

Computes in O(n) time (average).

\n

pub fn swap_remove_full<Q>(&mut self, value: &Q) -> Option<(usize, T)>
where\n Q: Hash + Equivalent<T> + ?Sized,

Remove the value from the set return it and the index it had.

\n

Like Vec::swap_remove, the value is removed by swapping it with the\nlast element of the set and popping it off. This perturbs\nthe position of what used to be the last element!

\n

Return None if value was not in the set.

\n

pub fn shift_remove_full<Q>(&mut self, value: &Q) -> Option<(usize, T)>
where\n Q: Hash + Equivalent<T> + ?Sized,

Remove the value from the set return it and the index it had.

\n

Like Vec::remove, the value is removed by shifting all of the\nelements that follow it, preserving their relative order.\nThis perturbs the index of all of those elements!

\n

Return None if value was not in the set.

\n
",0,"egglog::util::IndexSet"],["
§

impl<T, S> IndexSet<T, S>
where\n T: Eq + Hash,\n S: BuildHasher,

pub fn is_disjoint<S2>(&self, other: &IndexSet<T, S2>) -> bool
where\n S2: BuildHasher,

Returns true if self has no elements in common with other.

\n

pub fn is_subset<S2>(&self, other: &IndexSet<T, S2>) -> bool
where\n S2: BuildHasher,

Returns true if all elements of self are contained in other.

\n

pub fn is_superset<S2>(&self, other: &IndexSet<T, S2>) -> bool
where\n S2: BuildHasher,

Returns true if all elements of other are contained in self.

\n
",0,"egglog::util::IndexSet"],["
§

impl<T, S> IndexSet<T, S>
where\n T: Hash + Eq,\n S: BuildHasher,

pub fn insert(&mut self, value: T) -> bool

Insert the value into the set.

\n

If an equivalent item already exists in the set, it returns\nfalse leaving the original value in the set and without\naltering its insertion order. Otherwise, it inserts the new\nitem and returns true.

\n

Computes in O(1) time (amortized average).

\n

pub fn insert_full(&mut self, value: T) -> (usize, bool)

Insert the value into the set, and get its index.

\n

If an equivalent item already exists in the set, it returns\nthe index of the existing item and false, leaving the\noriginal value in the set and without altering its insertion\norder. Otherwise, it inserts the new item and returns the index\nof the inserted item and true.

\n

Computes in O(1) time (amortized average).

\n

pub fn insert_sorted(&mut self, value: T) -> (usize, bool)
where\n T: Ord,

Insert the value into the set at its ordered position among sorted values.

\n

This is equivalent to finding the position with\n[binary_search][Self::binary_search], and if needed calling\n[insert_before][Self::insert_before] for a new value.

\n

If the sorted item is found in the set, it returns the index of that\nexisting item and false, without any change. Otherwise, it inserts the\nnew item and returns its sorted index and true.

\n

If the existing items are not already sorted, then the insertion\nindex is unspecified (like slice::binary_search), but the value\nis moved to or inserted at that position regardless.

\n

Computes in O(n) time (average). Instead of repeating calls to\ninsert_sorted, it may be faster to call batched [insert][Self::insert]\nor [extend][Self::extend] and only call [sort][Self::sort] or\n[sort_unstable][Self::sort_unstable] once.

\n

pub fn insert_before(&mut self, index: usize, value: T) -> (usize, bool)

Insert the value into the set before the value at the given index, or at the end.

\n

If an equivalent item already exists in the set, it returns false leaving the\noriginal value in the set, but moved to the new position. The returned index\nwill either be the given index or one less, depending on how the value moved.\n(See shift_insert for different behavior here.)

\n

Otherwise, it inserts the new value exactly at the given index and returns true.

\n

Panics if index is out of bounds.\nValid indices are 0..=set.len() (inclusive).

\n

Computes in O(n) time (average).

\n
§Examples
\n
use indexmap::IndexSet;\nlet mut set: IndexSet<char> = ('a'..='z').collect();\n\n// The new value '*' goes exactly at the given index.\nassert_eq!(set.get_index_of(&'*'), None);\nassert_eq!(set.insert_before(10, '*'), (10, true));\nassert_eq!(set.get_index_of(&'*'), Some(10));\n\n// Moving the value 'a' up will shift others down, so this moves *before* 10 to index 9.\nassert_eq!(set.insert_before(10, 'a'), (9, false));\nassert_eq!(set.get_index_of(&'a'), Some(9));\nassert_eq!(set.get_index_of(&'*'), Some(10));\n\n// Moving the value 'z' down will shift others up, so this moves to exactly 10.\nassert_eq!(set.insert_before(10, 'z'), (10, false));\nassert_eq!(set.get_index_of(&'z'), Some(10));\nassert_eq!(set.get_index_of(&'*'), Some(11));\n\n// Moving or inserting before the endpoint is also valid.\nassert_eq!(set.len(), 27);\nassert_eq!(set.insert_before(set.len(), '*'), (26, false));\nassert_eq!(set.get_index_of(&'*'), Some(26));\nassert_eq!(set.insert_before(set.len(), '+'), (27, true));\nassert_eq!(set.get_index_of(&'+'), Some(27));\nassert_eq!(set.len(), 28);
\n

pub fn shift_insert(&mut self, index: usize, value: T) -> bool

Insert the value into the set at the given index.

\n

If an equivalent item already exists in the set, it returns false leaving\nthe original value in the set, but moved to the given index.\nNote that existing values cannot be moved to index == set.len()!\n(See insert_before for different behavior here.)

\n

Otherwise, it inserts the new value at the given index and returns true.

\n

Panics if index is out of bounds.\nValid indices are 0..set.len() (exclusive) when moving an existing value, or\n0..=set.len() (inclusive) when inserting a new value.

\n

Computes in O(n) time (average).

\n
§Examples
\n
use indexmap::IndexSet;\nlet mut set: IndexSet<char> = ('a'..='z').collect();\n\n// The new value '*' goes exactly at the given index.\nassert_eq!(set.get_index_of(&'*'), None);\nassert_eq!(set.shift_insert(10, '*'), true);\nassert_eq!(set.get_index_of(&'*'), Some(10));\n\n// Moving the value 'a' up to 10 will shift others down, including the '*' that was at 10.\nassert_eq!(set.shift_insert(10, 'a'), false);\nassert_eq!(set.get_index_of(&'a'), Some(10));\nassert_eq!(set.get_index_of(&'*'), Some(9));\n\n// Moving the value 'z' down to 9 will shift others up, including the '*' that was at 9.\nassert_eq!(set.shift_insert(9, 'z'), false);\nassert_eq!(set.get_index_of(&'z'), Some(9));\nassert_eq!(set.get_index_of(&'*'), Some(10));\n\n// Existing values can move to len-1 at most, but new values can insert at the endpoint.\nassert_eq!(set.len(), 27);\nassert_eq!(set.shift_insert(set.len() - 1, '*'), false);\nassert_eq!(set.get_index_of(&'*'), Some(26));\nassert_eq!(set.shift_insert(set.len(), '+'), true);\nassert_eq!(set.get_index_of(&'+'), Some(27));\nassert_eq!(set.len(), 28);
\n\n
use indexmap::IndexSet;\nlet mut set: IndexSet<char> = ('a'..='z').collect();\n\n// This is an invalid index for moving an existing value!\nset.shift_insert(set.len(), 'a');
\n

pub fn replace(&mut self, value: T) -> Option<T>

Adds a value to the set, replacing the existing value, if any, that is\nequal to the given one, without altering its insertion order. Returns\nthe replaced value.

\n

Computes in O(1) time (average).

\n

pub fn replace_full(&mut self, value: T) -> (usize, Option<T>)

Adds a value to the set, replacing the existing value, if any, that is\nequal to the given one, without altering its insertion order. Returns\nthe index of the item and its replaced value.

\n

Computes in O(1) time (average).

\n

pub fn difference<'a, S2>(\n &'a self,\n other: &'a IndexSet<T, S2>\n) -> Difference<'a, T, S2>
where\n S2: BuildHasher,

Return an iterator over the values that are in self but not other.

\n

Values are produced in the same order that they appear in self.

\n

pub fn symmetric_difference<'a, S2>(\n &'a self,\n other: &'a IndexSet<T, S2>\n) -> SymmetricDifference<'a, T, S, S2>
where\n S2: BuildHasher,

Return an iterator over the values that are in self or other,\nbut not in both.

\n

Values from self are produced in their original order, followed by\nvalues from other in their original order.

\n

pub fn intersection<'a, S2>(\n &'a self,\n other: &'a IndexSet<T, S2>\n) -> Intersection<'a, T, S2>
where\n S2: BuildHasher,

Return an iterator over the values that are in both self and other.

\n

Values are produced in the same order that they appear in self.

\n

pub fn union<'a, S2>(&'a self, other: &'a IndexSet<T, S2>) -> Union<'a, T, S>
where\n S2: BuildHasher,

Return an iterator over all values that are in self or other.

\n

Values from self are produced in their original order, followed by\nvalues that are unique to other in their original order.

\n

pub fn splice<R, I>(\n &mut self,\n range: R,\n replace_with: I\n) -> Splice<'_, <I as IntoIterator>::IntoIter, T, S>
where\n R: RangeBounds<usize>,\n I: IntoIterator<Item = T>,

Creates a splicing iterator that replaces the specified range in the set\nwith the given replace_with iterator and yields the removed items.\nreplace_with does not need to be the same length as range.

\n

The range is removed even if the iterator is not consumed until the\nend. It is unspecified how many elements are removed from the set if the\nSplice value is leaked.

\n

The input iterator replace_with is only consumed when the Splice\nvalue is dropped. If a value from the iterator matches an existing entry\nin the set (outside of range), then the original will be unchanged.\nOtherwise, the new value will be inserted in the replaced range.

\n

Panics if the starting point is greater than the end point or if\nthe end point is greater than the length of the set.

\n
§Examples
\n
use indexmap::IndexSet;\n\nlet mut set = IndexSet::from([0, 1, 2, 3, 4]);\nlet new = [5, 4, 3, 2, 1];\nlet removed: Vec<_> = set.splice(2..4, new).collect();\n\n// 1 and 4 kept their positions, while 5, 3, and 2 were newly inserted.\nassert!(set.into_iter().eq([0, 1, 5, 3, 2, 4]));\nassert_eq!(removed, &[2, 3]);
\n

pub fn append<S2>(&mut self, other: &mut IndexSet<T, S2>)

Moves all values from other into self, leaving other empty.

\n

This is equivalent to calling [insert][Self::insert] for each value\nfrom other in order, which means that values that already exist\nin self are unchanged in their current position.

\n

See also [union][Self::union] to iterate the combined values by\nreference, without modifying self or other.

\n
§Examples
\n
use indexmap::IndexSet;\n\nlet mut a = IndexSet::from([3, 2, 1]);\nlet mut b = IndexSet::from([3, 4, 5]);\nlet old_capacity = b.capacity();\n\na.append(&mut b);\n\nassert_eq!(a.len(), 5);\nassert_eq!(b.len(), 0);\nassert_eq!(b.capacity(), old_capacity);\n\nassert!(a.iter().eq(&[3, 2, 1, 4, 5]));
\n
",0,"egglog::util::IndexSet"],["
§

impl<'de, T, S, E> IntoDeserializer<'de, E> for IndexSet<T, S>
where\n T: IntoDeserializer<'de, E> + Eq + Hash,\n S: BuildHasher,\n E: Error,

§

type Deserializer = SeqDeserializer<<IndexSet<T, S> as IntoIterator>::IntoIter, E>

The type of the deserializer being converted into.
§

fn into_deserializer(\n self\n) -> <IndexSet<T, S> as IntoDeserializer<'de, E>>::Deserializer

Convert this value into a deserializer.
","IntoDeserializer<'de, E>","egglog::util::IndexSet"],["
§

impl<T, S> IntoIterator for IndexSet<T, S>

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?
§

fn into_iter(self) -> <IndexSet<T, S> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
","IntoIterator","egglog::util::IndexSet"],["
§

impl<T, S> MutableValues for IndexSet<T, S>
where\n S: BuildHasher,

Opt-in mutable access to [IndexSet] values.

\n

See [MutableValues] for more information.

\n
§

type Value = T

§

fn get_full_mut2<Q>(&mut self, value: &Q) -> Option<(usize, &mut T)>
where\n Q: Hash + Equivalent<T> + ?Sized,

Return item index and mutable reference to the value Read more
§

fn get_index_mut2(&mut self, index: usize) -> Option<&mut T>

Return mutable reference to the value at an index. Read more
§

fn retain2<F>(&mut self, keep: F)
where\n F: FnMut(&mut T) -> bool,

Scan through each value in the set and keep those where the\nclosure keep returns true. Read more
","MutableValues","egglog::util::IndexSet"],["
§

impl<T, S1, S2> PartialEq<IndexSet<T, S2>> for IndexSet<T, S1>
where\n T: Hash + Eq,\n S1: BuildHasher,\n S2: BuildHasher,

§

fn eq(&self, other: &IndexSet<T, S2>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq>","egglog::util::IndexSet"],["
§

impl<T, S> Serialize for IndexSet<T, S>
where\n T: Serialize,

§

fn serialize<Se>(\n &self,\n serializer: Se\n) -> Result<<Se as Serializer>::Ok, <Se as Serializer>::Error>
where\n Se: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","egglog::util::IndexSet"],["
§

impl<T, S> Eq for IndexSet<T, S>
where\n T: Eq + Hash,\n S: BuildHasher,

","Eq","egglog::util::IndexSet"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/type.impl/std/primitive.bool.js b/docs/type.impl/std/primitive.bool.js new file mode 100644 index 00000000..e7a15a17 --- /dev/null +++ b/docs/type.impl/std/primitive.bool.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"egglog":[["
source§

impl FromSort for bool

§

type Sort = BoolSort

source§

fn load(_sort: &Self::Sort, value: &Value) -> Self

","FromSort","egglog::ast::Subsume"],["
source§

impl IntoSort for bool

§

type Sort = BoolSort

source§

fn store(self, _sort: &Self::Sort) -> Option<Value>

","IntoSort","egglog::ast::Subsume"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/type.impl/std/primitive.fn.js b/docs/type.impl/std/primitive.fn.js new file mode 100644 index 00000000..5a6c7514 --- /dev/null +++ b/docs/type.impl/std/primitive.fn.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"egglog":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs/type.impl/std/primitive.usize.js b/docs/type.impl/std/primitive.usize.js new file mode 100644 index 00000000..f3ad9d72 --- /dev/null +++ b/docs/type.impl/std/primitive.usize.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"egglog":[["
source§

impl ToSexp for usize

source§

fn to_sexp(&self) -> Sexp

","ToSexp","egglog::termdag::TermId"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/examples.json b/examples.json new file mode 100644 index 00000000..27ef8b0e --- /dev/null +++ b/examples.json @@ -0,0 +1,82 @@ +{ + "antiunify": "(datatype Expr\n (Num i64)\n (Var String)\n (Add Expr Expr))\n\n(rewrite (Add x y) (Add y x))\n(rewrite (Add (Num x) (Num y)) (Num (+ x y)))\n\n;; antiunificaiton returns an expression that could unify with either\n;; of the input expressions\n;; (AU x y) can be considered a placeholder variable\n(function AU (Expr Expr) Expr)\n\n(rewrite (AU x x) x)\n(rewrite\n (AU (Add a b) (Add c d))\n (Add (AU a c) (AU b d)))\n\n(let e1 (Add (Var \"x\") (Add (Num 1) (Num 2))))\n(let e2 (Add (Num 3) (Var \"y\")))\n\n(let au12 (AU e1 e2))\n\n(run 4)\n(check (= au12 (Add (Num 3) (AU (Var \"x\") (Var \"y\")))))\n(query-extract au12)\n", + "array": "; Smtlib theory of arrays\n; https://smtlib.cs.uiowa.edu/theories-ArraysEx.shtml\n; http://smtlib.cs.uiowa.edu/version1/theories/Arrays.smt\n\n(datatype Math\n (Num i64)\n (Var String)\n)\n\n\n(datatype Array\n (Const i64)\n (AVar String)\n)\n\n(function add (Math Math) Math)\n(function select (Array Math) Math)\n(function store (Array Math Math) Array)\n\n(relation neq (Math Math))\n\n(rule ((neq x y))\n ((neq y x)))\n\n(rule ((neq x x))\n ((panic \"query (neq x x) found something equal to itself\")))\n\n\n; injectivity rules take not equal to not equal.\n(rule ((neq x y) (= (add x z) e))\n ((neq (add x z) (add y z))))\n(rule ((= (add x (Num i)) e) (!= i 0))\n ((neq e x)))\n\n\n(rule ((= (Num a) n1) (= (Num b) n2) (!= a b))\n ((neq n1 n2)))\n\n; select gets from store\n(rewrite (select (store mem i e) i) e)\n; select passes through wrong index\n(rule ((= (select (store mem i1 e) i2) e1) (neq i1 i2))\n ((union (select mem i2) e1)))\n; aliasing writes destroy old value\n(rewrite (store (store mem i e1) i e2) (store mem i e2))\n; non-aliasing writes commutes\n(rule ((= (store (store mem i2 e2) i1 e1) mem1) (neq i1 i2))\n ((union (store (store mem i1 e1) i2 e2) mem1)))\n\n; typical math rules\n(rewrite (add x y) (add y x))\n(rewrite (add (add x y) z) (add x (add y z)))\n(rewrite (add (Num x) (Num y)) (Num (+ x y)))\n(rewrite (add x (Num 0)) x)\n\n(push)\n(let r1 (Var \"r1\"))\n(let r2 (Var \"r2\"))\n(let r3 (Var \"r3\"))\n(let mem1 (AVar \"mem1\"))\n\n(neq r1 r2)\n(neq r2 r3)\n(neq r1 r3)\n(let test1 (select (store mem1 r1 (Num 42)) r1))\n(let test2 (select (store mem1 r1 (Num 42)) (add r1 (Num 17))))\n(let test3 (select (store (store mem1 (add r1 r2) (Num 1)) (add r2 r1) (Num 2)) (add r1 r3)))\n(let test4 (add (Num 1) (add (add (Num 1) (add (Num 1) r1)) (Num -3))))\n\n(run 5)\n(check (= test1 (Num 42)))\n(check (neq r1 r2))\n(check (neq r1 (add r1 (Num 17))))\n(check (= test2 (select mem1 (add r1 (Num 17)))))\n(check (= test3 (select mem1 (add r1 r3))))\n(check (= test4 r1))\n(pop)\n", + "bdd": "; Binary Decision Diagrams are if-then-else trees/ compressed tries that hash cons their leaves\n; This is easily expressible in the facilities provided. Everything in egglog is automatcally shared\n; and Compression is easily expressible as a rule.\n\n; They are a notion of first class set useful for certain classes of uniformly describable sets.\n; https://en.wikipedia.org/wiki/Binary_decision_diagram\n; https://www.lri.fr/~filliatr/ftp/publis/hash-consing2.pdf Type-Safe Modular Hash-Consing - Section 3.3\n\n(datatype BDD\n (ITE i64 BDD BDD) ; variables labelled by number\n)\n(function TrueConst () BDD)\n(let True (TrueConst))\n(function FalseConst () BDD)\n(let False (FalseConst))\n\n; compress unneeded nodes\n(rewrite (ITE n a a) a)\n\n(function bddand (BDD BDD) BDD)\n(rewrite (bddand x y) (bddand y x))\n(rewrite (bddand False n) False)\n(rewrite (bddand True x) x)\n\n; We use an order where low variables are higher in tree\n; Could go the other way.\n(rewrite (bddand (ITE n a1 a2) (ITE m b1 b2))\n (ITE n (bddand a1 (ITE m b1 b2)) (bddand a2 (ITE m b1 b2)))\n :when ((< n m))\n)\n(rewrite (bddand (ITE n a1 a2) (ITE n b1 b2))\n (ITE n (bddand a1 b1) (bddand a2 b2))\n)\n\n(function bddor (BDD BDD) BDD)\n(rewrite (bddor x y) (bddor y x))\n(rewrite (bddor True n) True)\n(rewrite (bddor False x) x)\n(rewrite (bddor (ITE n a1 a2) (ITE m b1 b2))\n (ITE n (bddor a1 (ITE m b1 b2)) (bddor a2 (ITE m b1 b2)))\n :when ((< n m))\n)\n(rewrite (bddor (ITE n a1 a2) (ITE n b1 b2))\n (ITE n (bddor a1 b1) (bddor a2 b2))\n)\n\n(function bddnot (BDD) BDD)\n(rewrite (bddnot True) False)\n(rewrite (bddnot False) True)\n(rewrite (bddnot (ITE n a1 a2)) (ITE n (bddnot a1) (bddnot a2)))\n\n\n(function bddxor (BDD BDD) BDD)\n(rewrite (bddxor x y) (bddxor y x))\n(rewrite (bddxor True n) (bddnot n))\n(rewrite (bddxor False x) x)\n\n(rewrite (bddxor (ITE n a1 a2) (ITE m b1 b2))\n (ITE n (bddxor a1 (ITE m b1 b2)) (bddxor a2 (ITE m b1 b2)))\n :when ((< n m))\n)\n(rewrite (bddxor (ITE n a1 a2) (ITE n b1 b2))\n (ITE n (bddxor a1 b1) (bddxor a2 b2))\n)\n\n(push)\n;;; Tests\n\n(let v0 (ITE 0 True False))\n(let v1 (ITE 1 True False))\n(let v2 (ITE 2 True False))\n\n(let t0 (bddnot (bddnot v0)))\n(let t1 (bddor v0 (bddnot v0)))\n(let t2 (bddand v0 (bddnot v0)))\n(let t3 (bddand v0 v0))\n(let t4 (bddor v0 v0))\n(let t5 (bddxor (bddnot v0) v0))\n(let t6 (bddand (bddor v1 v2) v2))\n\n(let t7a (bddxor (bddnot v0) v1))\n(let t7b (bddxor v0 (bddnot v1)))\n(let t7c (bddnot (bddxor v0 v1)))\n\n(let t8 (bddand v1 v2))\n\n(let t9 (bddand (bddnot v1) (bddand (bddnot v0) (bddxor v0 v1))))\n(let t10 (bddor (bddnot v1) (bddor (bddnot v0) (bddxor v0 (bddnot v1)))))\n\n(run 30)\n\n(check (= t0 v0)) ; bddnot cancels\n(check (= t1 True))\n(check (= t2 False))\n(check (= t3 v0))\n(check (= t4 v0))\n(check (= t5 True))\n(check (= t6 v2))\n\n(check (= t7a t7b))\n(check (= t7a t7c))\n\n(check (= t8 (ITE 1 (ITE 2 True False) False)))\n\n(check (= t9 False))\n(check (= t10 True))\n(pop)\n", + "before-proofs": "(datatype Math\n (Add Math Math)\n (Sub Math Math)\n (Const Rational)\n (Var String))\n\n(rewrite (Add a b) (Add (Add a b) (Const (rational 0 1))))\n\n(rewrite (Add a b) (Add b a))\n\n\n(rewrite (Add a (Add b c))\n (Add (Add a b) c))\n\n(let two (rational 2 1))\n(let start1 (Add (Var \"x\") (Const two)))\n;; add original proofs\n\n(run 3)\n\n\n(check (!= (Var \"x\") (Const two)))\n(check (= (Add (Var \"x\") (Const two))\n (Add (Const two) (Var \"x\"))))\n\n(let zero (Const (rational 0 1)))\n(let addx2 (Add (Var \"x\") (Const two)))\n(let addx20 (Add addx2 zero))\n(let addzerofront (Add (Add zero (Var \"x\")) (Const two)))\n\n(check (= addx2\n addx20))\n", + "bignum": "\n(let x (bigint -1234))\n(let y (from-string \"2\"))\n(let z (bigrat x y))\n(check (= (to-string (numer z)) \"-617\"))\n\n(function bignums (BigInt BigInt) BigRat)\n(set (bignums x y) z)\n(check\n\t(= (bignums a b) c)\n\t(= (numer c) (>> a 1))\n\t(= (denom c) (>> b 1))\n)\n", + "birewrite": "(datatype Math (Add Math Math) (Lit i64))\n\n(birewrite (Add (Add x y) z) (Add x (Add y z)))\n\n(let a (Lit 1))\n(let b (Lit 2))\n(let c (Lit 3))\n\n(let d (Lit 4))\n(let e (Lit 5))\n(let f (Lit 6))\n\n(let ex1 (Add (Add a b) c))\n(let ex2 (Add d (Add e f)))\n\n(run 10)\n(check (= ex1 (Add a (Add b c))))\n(check (= ex2 (Add (Add d e) f)))\n", + "bitwise": "(check (= 0 (& 10 0)))\n(check (= 8 (& 8 10)))\n(check (= 10 (| 8 10)))\n(check (= 2 (^ 8 10)))\n(check (= 8 (<< 1 3)))\n(check (= 1 (>> 8 3)))\n(check (= 2 (% 8 3)))\n(check (= 2 (/ 8 3)))\n(check (= -1 (not-i64 0)))\n\n; bitsets\n;(function bs-union (i64 i64) i64)\n;(rewrite (bs-union a b) (| a b))\n\n;(function bs-inter (i64 i64) i64)\n;(rewrite (bs-inter a b) (& a b))\n\n;(function bs-comp (i64) i64)\n;(rewrite (bs-comp a) (bvnot a))\n\n; singleton set\n;(function bs-sing (i64) i64)\n;(rewrite (bs-sing a) (1 << a))\n\n;(function bs-insert (i64 i64) i64)\n;(rewrite (bs-insert s x) (| s (1 << a))\n\n;(function bs-diff (i64 i64) i64)\n;(rewrite (bs-diff a b) (^ a (bs-inter a b))\n\n;(let bs-empty 0)\n\n;(let bs-subset (i64 i64) bool)\n;(rewrite (bs-subset x y) (is-zero (bs-diff x y)))\n\n;(let bs-is-elem (i64 i64) bool)\n;(rewrite (bs-is-elem s x) (not (is-zero (bs-inter s (sing x)))))\n", + "bool": "\n(check (= (and true true) true))\n(check (= (and true false) false))\n(check (= (or true false) true))\n(check (!= (or true false) false))\n\n(check (= (bool-= 1 1) true))\n(check (= (bool-= -5 -5) true))\n(check (= (bool-= 1 3) false))\n(check (= (bool-= 3 1) false))\n\n(check (= (bool-< 1 2) true))\n(check (= (bool-< 2 1) false))\n(check (= (bool-< 1 1) false))\n\n(check (= (bool-<= 1 2) true))\n(check (= (bool-<= 2 1) false))\n(check (= (bool-<= 1 1) true))\n\n(check (= (bool-> 1 2) false))\n(check (= (bool-> 2 1) true))\n(check (= (bool-> 1 1) false))\n\n(check (= (bool->= 1 2) false))\n(check (= (bool->= 2 1) true))\n(check (= (bool->= 1 1) true))\n\n; Test bool's tag\n(relation R (i64))\n(function F (i64) bool)\n\n(rule\n ((R i))\n ((set (F i) true))\n)\n\n(R 0)\n\n(run 3)\n", + "calc": "(datatype G)\n(function IConst () G)\n(let I (IConst))\n(function AConst () G)\n(let A (AConst))\n(function BConst () G)\n(let B (BConst))\n(function g* (G G) G)\n(function inv (G) G)\n(birewrite (g* (g* a b) c) (g* a (g* b c))) ; assoc\n(rewrite (g* I a) a) ; idl\n(rewrite (g* a I) a) ; idr\n(rewrite (g* (inv a) a) I) ; invl\n(rewrite (g* a (inv a)) I) ; invr\n\n; A is cyclic of period 4\n(rewrite (g* A (g* A (g* A A))) I)\n\n(let A2 (g* A A))\n(let A4 (g* A2 A2))\n(let A8 (g* A4 A4))\n\n\n(push)\n(g* A4 A4)\n\n(run 10000 :until (= (g* A4 A4) (g* (g* A2 A2) (g* A2 A2))))\n\n(check (= (g* A4 A4) (g* (g* A2 A2) (g* A2 A2))))\n(pop)\n\n(push)\n(g* (g* A2 A2) (g* A2 A2))\n\n(run 10000 :until (= (g* (g* A2 A2) (g* A2 A2))\n(g* A2 (g* A2 (g* A2 A2)))))\n(check (= (g* (g* A2 A2) (g* A2 A2))\n(g* A2 (g* A2 (g* A2 A2)))))\n(pop)\n\n\n(function aConst () G)\n(function bConst () G)\n(let a (aConst))\n(let b (bConst))\n(push)\n\n(g* (g* b (g* (inv a) a)) (inv b))\n\n(run 100000 :until (= (g* (g* b (g* (inv a) a)) (inv b)) (g* b (inv b))))\n\n(check (= (g* (g* b (g* (inv a) a)) (inv b)) (g* b (inv b))))\n\n(pop)\n\n(push)\n(g* b (inv b))\n(run 100000 :until (= (g* b (inv b)) I))\n(check (= (g* b (inv b)) I))\n\n(pop)\n", + "combinators": "; Substitution in lambda-calculus via S/K/I combinators. Extremely slow, as\n; abstraction elimination does not pay attention to whether variables are free\n; in an expression before introducing 'S'.\n;\n; Provides an example of how to implement substitution by embedding in a\n; 'richer' data-type and then mapping back to syntax.\n\n(datatype Expr\n (Var String :cost 100)\n (Abs String Expr)\n (If Expr Expr Expr)\n (N i64)\n (Add Expr Expr)\n (App Expr Expr))\n(function TConst () Expr)\n(let T (TConst))\n(function FConst () Expr)\n(let F (FConst))\n\n\n; (\\x. (if x then 0 else 1) + 2) false\n(let test\n (App \n (Abs \"x\" (Add (If (Var \"x\") (N 0) (N 1)) (N 2))) F))\n\n(datatype CExpr\n (CVar String :cost 10000) ; (variables that haven't been eliminated yet)\n (CAbs String CExpr :cost 10000) ; (abstractions that haven't been eliminated yet)\n (CN i64)\n (CApp CExpr CExpr))\n(function CTConst () CExpr)\n(let CT (CTConst))\n(function CFConst () CExpr)\n(let CF (CFConst))\n(function CIfConst () CExpr)\n(let CIf (CIfConst))\n(function CAddConst () CExpr)\n(let CAdd (CAddConst))\n(function SConst () CExpr)\n(let S (SConst))\n(function KConst () CExpr)\n(let K (KConst))\n(function IConst () CExpr)\n(let I (IConst))\n\n;;;; Conversion functions\n(function Comb (Expr) CExpr :cost 1000000)\n(function Uncomb (CExpr) Expr) \n(rewrite (Comb (Uncomb cx)) cx)\n(rewrite (Uncomb (Comb x)) x)\n\n; Mechanical mappings back and forth.\n; Note: we avoid resugaring S/K/I\n(rule ((= x (N n))) ((union (Comb x) (CN n))))\n(rule ((= cx (CN n))) ((union (Uncomb cx) (N n))))\n(rule ((= x T)) ((union (Comb x) CT)))\n(rule ((= cx CT)) ((union (Uncomb cx) T)))\n(rule ((= x F)) ((union (Comb x) CF)))\n(rule ((= cx CF)) ((union (Uncomb cx) F)))\n\n(rule ((= x (If c t f)))\n ((union (Comb x) (CApp (CApp (CApp CIf (Comb c)) (Comb t)) (Comb f)))))\n(rule ((= cx (CApp (CApp (CApp CIf cc) ct) cf)))\n ((union (Uncomb cx) (If (Uncomb cc) (Uncomb ct) (Uncomb cf)))))\n\n(rule ((= x (Add l r)))\n ((union (Comb x) (CApp (CApp CAdd (Comb l)) (Comb r)))))\n(rule ((= cx (CApp (CApp CAdd cl) cr)))\n ((union (Uncomb cx) (Add (Uncomb cl) (Uncomb cr)))))\n(rule ((= x (App f a))) ((union (Comb x) (CApp (Comb f) (Comb a)))))\n\n(rule ((= x (Var v))) ((union (Comb x) (CVar v))))\n(rule ((= x (Abs v body))) ((union (Comb x) (CAbs v (Comb body)))))\n\n;;;; Abstraction Elimination \n(rewrite (CAbs v (CVar v)) I)\n; Hacks, could be replaced by !free computation.\n(rewrite (CAbs v1 (CVar v2)) (CApp K (CVar v2)) \n :when ((!= v1 v2)))\n(rewrite (CAbs v (CN n)) (CApp K (CN n)))\n(rewrite (CAbs v CT) (CApp K CT))\n(rewrite (CAbs v CF) (CApp K CF))\n(rewrite (CAbs v CIf) (CApp K CIf))\n(rewrite (CAbs v CAdd) (CApp K CAdd))\n(rewrite (CAbs v (CApp x y)) (CApp (CApp S (CAbs v x)) (CAbs v y)))\n; May be needed for multiple nested variables\n(rewrite (CAbs v (CApp K (CVar v))) K)\n\n;;;; Primitive Evaluation rules (letd on \"surface syntax\")\n(rewrite (If T t f) t)\n(rewrite (If F t f) f)\n(rewrite (Add (N n) (N m)) (N (+ n m)))\n\n;;;; Substitution Rules (letd on the combinator representation)\n(rewrite (CApp I cx) cx)\n(rewrite (CApp (CApp K cx) cy) cx)\n; Without demand, this can cause an explosion in DB size.\n(rewrite (CApp (CApp (CApp S cx) cy) cz) (CApp (CApp cx cz) (CApp cy cz)))\n\n(run 11)\n(query-extract (Comb test))\n(check (= test (N 3)))", + "combined-nested": "(relation number (i64))\n\n\n(ruleset myrules1)\n(rule ()\n ((number 1))\n :ruleset myrules1)\n(ruleset myrules2)\n(rule ()\n ((number 2))\n :ruleset myrules2)\n\n(unstable-combined-ruleset rules1and2\n myrules1 myrules2)\n\n;; allowed to add to myrules2 and the change is reflected\n(rule ()\n ((number 3))\n :ruleset myrules2)\n\n;; not allowed to add to combined ruleset\n(fail\n (rule ()\n ((number 4))\n :ruleset myrules1and2))\n\n\n(fail\n (rule ()\n ((number 4))\n :ruleset unboundruleset))\n\n(ruleset myrules5)\n(rule ()\n ((number 5))\n :ruleset myrules5)\n\n(unstable-combined-ruleset rules1and2and5\n rules1and2 myrules5)\n\n(run-schedule\n rules1and2and5)\n\n(check (number 1))\n(check (number 2))\n(check (number 3))\n(check (number 5))\n(fail (check (number 4)))\n", + "container-rebuild": "(push)\n(datatype Math\n (Num i64))\n\n(sort MathVec (Vec Math))\n\n(let v1 (vec-of (Num 1) (Num 2)))\n(let v2 (vec-of (Num 2) (Num 2)))\n\n(union (Num 1) (Num 2))\n\n(check (= v1 v2))\n\n(function MyVec (MathVec) Math)\n\n(MyVec v1)\n\n(check (MyVec v2))\n\n(check (= (MyVec v1) (MyVec v2)))\n\n(let v3 (vec-of (Num 4) (Num 5)))\n\n(union (Num 4) (Num 6))\n(union (Num 5) (Num 7))\n\n;; We don't have any (MyVec v3) yet\n(fail (check (= (MyVec v3) (MyVec (vec-of (Num 6) (Num 7))))))\n\n(MyVec v3)\n(check (= (MyVec v3) (MyVec (vec-of (Num 6) (Num 7)))))\n\n(pop)\n\n(push)\n\n(datatype Math\n (Num i64))\n\n(sort MathVec (Vec Math))\n\n\n(let v1 (vec-of (Num 1) (Num 2)))\n(let v2 (vec-of (Num 2) (Num 2)))\n\n(union (Num 1) (Num 2))\n\n(function MyVec (MathVec) Math)\n\n;; make a reference to v1\n(MyVec v1)\n\n(extract (MyVec v1))\n\n;; rebuilding creates (MyVec v2)\n(check (= (MyVec v1) (MyVec v2)))\n(pop)\n\n(push)\n(datatype Math\n (Add i64 i64)\n (Expensive :cost 100))\n\n(sort MathVec (Vec Math))\n\n(let myvec (vec-of (Expensive)))\n(let cheapvec (vec-of (Add 1 2)))\n\n(function VecContainer (MathVec) Math)\n\n(let myvecontainer (VecContainer cheapvec))\n\n\n(union myvecontainer (Expensive))\n\n;; (vec-push (vec-empty) (VecContainer (vec-push (vec-empty) (Add 1 2))))\n;; should have cost 4\n(extract myvec 0)\n\n(pop)", + "cyk": "(datatype term (Term String))\n(datatype nonterm (NonTerm String))\n(datatype tree (NT String tree tree)\n (T String String))\n\n(function getString (i64) String)\n\n(relation Prod (nonterm nonterm nonterm))\n(relation End (nonterm String))\n\n\n\n(relation P (i64 i64 nonterm))\n(function B (i64 i64 nonterm) tree :cost 1000)\n\n(rule ((End (NonTerm a) s)\n (= s (getString pos)))\n ((P 1 pos (NonTerm a))\n (union (B 1 pos (NonTerm a)) (T a s)))) \n\n(rule ((Prod (NonTerm a) (NonTerm b) (NonTerm c)) ;; a -> bc\n (P p1 s (NonTerm b))\n (P p2 (+ s p1) (NonTerm c)))\n ((P (+ p1 p2) s (NonTerm a))))\n\n\n(rule ((Prod (NonTerm a) (NonTerm b) (NonTerm c))\n (= f1 (B p1 s (NonTerm b)))\n (= f2 (B p2 (+ s p1) (NonTerm c))))\n ((union (B (+ p1 p2) s (NonTerm a)) \n (NT a f1 f2))))\n\n(push)\n\n\n(set (getString 1) \"she\")\n(set (getString 2) \"eats\")\n(set (getString 3) \"a\")\n(set (getString 4) \"fish\")\n(set (getString 5) \"with\")\n(set (getString 6) \"a\")\n(set (getString 7) \"fork\")\n\n\n(Prod (NonTerm \"S\") (NonTerm \"NP\") (NonTerm \"VP\"))\n(Prod (NonTerm \"VP\") (NonTerm \"VP\") (NonTerm \"PP\"))\n(Prod (NonTerm \"VP\") (NonTerm \"V\") (NonTerm \"NP\"))\n(End (NonTerm \"VP\") \"eats\")\n(Prod (NonTerm \"PP\") (NonTerm \"P\") (NonTerm \"NP\"))\n(Prod (NonTerm \"NP\") (NonTerm \"DET\") (NonTerm \"N\"))\n(End (NonTerm \"NP\") \"she\")\n(End (NonTerm \"V\") \"eats\")\n(End (NonTerm \"P\") \"with\")\n(End (NonTerm \"N\") \"fish\")\n(End (NonTerm \"N\") \"fork\")\n(End (NonTerm \"DET\") \"a\")\n\n\n(let test1 (B 7 1 (NonTerm \"S\")))\n\n(run 100)\n\n(check (P 7 1 (NonTerm \"S\")))\n(fail (check (P 7 1 (NonTerm \"VP\"))))\n(fail (check (P 7 1 (NonTerm \"\"))))\n\n(query-extract test1)\n\n(pop)\n\n(push)\n\n(Prod (NonTerm \"S\") (NonTerm \"A\") (NonTerm \"B\"))\n(Prod (NonTerm \"S\") (NonTerm \"B\") (NonTerm \"C\"))\n(Prod (NonTerm \"A\") (NonTerm \"B\") (NonTerm \"A\"))\n(End (NonTerm \"A\") \"a\")\n(Prod (NonTerm \"B\") (NonTerm \"C\") (NonTerm \"C\"))\n(End (NonTerm \"B\") \"b\")\n(Prod (NonTerm \"C\") (NonTerm \"A\") (NonTerm \"B\"))\n(End (NonTerm \"C\") \"a\")\n\n(push)\n\n(set (getString 1) \"a\")\n(set (getString 2) \"b\")\n(set (getString 3) \"a\")\n(set (getString 4) \"a\")\n(set (getString 5) \"b\")\n\n(run 100)\n(check (P 5 1 (NonTerm \"S\")))\n(fail (check (P 5 1 (NonTerm \"B\"))))\n(let test2 (B 5 1 (NonTerm \"S\")))\n(query-extract:variants 10 test2)\n\n(pop)\n\n(push)\n\n(set (getString 1) \"a\")\n(set (getString 2) \"a\")\n(set (getString 3) \"a\")\n(set (getString 4) \"a\")\n(set (getString 5) \"a\")\n\n(run 100)\n(check (P 5 1 (NonTerm \"S\")))\n(check (P 5 1 (NonTerm \"A\")))\n(fail (check (P 5 1 (NonTerm \"B\"))))\n(fail (check (P 5 1 (NonTerm \"\"))))\n(fail (check (P 5 1 (NonTerm \"unrelated\"))))\n(let test3 (B 5 1 (NonTerm \"S\")))\n(query-extract :variants 10 test3)\n\n(pop)", + "cykjson": "(datatype tree (NT String tree tree)\n (T String String))\n\n(function getString (i64) String)\n\n(relation Prod (String String String))\n(relation End (String String))\n\n\n(relation P (i64 i64 String))\n(function B (i64 i64 String) tree :cost 100000)\n\n(rule ((End a s)\n (= s (getString pos)))\n ((P 1 pos a)\n (union (B 1 pos a) (T a s)))) \n\n(rule ((Prod a b c) ;; a -> bc\n (P p1 s b)\n (P p2 (+ s p1) c))\n ((P (+ p1 p2) s a)))\n\n\n(rule ((Prod a b c)\n (= f1 (B p1 s b))\n (= f2 (B p2 (+ s p1) c)))\n ((union (B (+ p1 p2) s a) \n (NT a f1 f2))))\n\n\n(input Prod \"./tests/cykjson_Prod.csv\")\n(input End \"./tests/cykjson_End.csv\")\n\n; small size 801\n(input getString \"./tests/cykjson_small_token.csv\")\n\n; medium size 7821 but runs for 2 min.\n;(input getString \"./tests/cykjson_medium_token.csv\")\n\n(let test1 (B 801 1 \"VAL\"))\n\n(run 10000)\n\n(check (P 801 1 \"VAL\"))", + "datatypes": "(datatype*\n (Math\n (Add Math Math)\n (Sum MathVec)\n (B Bool))\n (sort MathVec (Vec Math))\n (Bool\n (True)\n (False)))\n\n(let expr (Add (Sum (vec-of (B (True)) (B (False)))) (B (True))))\n", + "delete": "(function foo (i64) i64)\n(set (foo 1) 7)\n(check (= (foo 1) 7))\n(delete (foo 1))\n(rule ((= x (foo 1))) ((panic \"foo 1 was there!\")))\n(run 1)", + "eggcc-extraction": "\n(datatype Literal)\n(datatype Expr)\n(datatype Operand)\n(datatype Body)\n\n(sort VecOperandBase (Vec Operand))\n(datatype VecOperand (VO VecOperandBase))\n\n(sort VecVecOperandBase (Vec VecOperand))\n(datatype VecVecOperand (VVO VecVecOperandBase))\n\n;; Type\n(datatype Type\n (IntT)\n (BoolT)\n (FloatT)\n (CharT)\n (PointerT Type))\n(datatype EffectType\n (Bril Type)\n (PrintState))\n(sort FuncSigs (Vec EffectType))\n(datatype OptionType\n (SomeType Type)\n (NoneType))\n;; Literal\n(function Num (i64) Literal)\n(function Float (f64) Literal)\n(function Char (String) Literal)\n(function Bool (bool) Literal)\n\n;; Expr\n(datatype ConstOps (const))\n(function Const (Type ConstOps Literal) Expr)\n;; Call may return multiple values but at most one of them\n;; is a value type, which is stored in OptionType.\n;; The last fields denotes how many return values it have\n;; Finally, we assume if call ever returns a value, \n;; it has to be the first one.\n(function Call (OptionType String VecOperand i64) Expr :cost 1000) ; TODO: fix cost model\n(function badd (Type Operand Operand) Expr)\n(function bsub (Type Operand Operand) Expr)\n(function bmul (Type Operand Operand) Expr)\n(function bfmul (Type Operand Operand) Expr)\n(function bdiv (Type Operand Operand) Expr)\n(function beq (Type Operand Operand) Expr)\n(function blt (Type Operand Operand) Expr)\n(function bgt (Type Operand Operand) Expr)\n(function ble (Type Operand Operand) Expr)\n(function bge (Type Operand Operand) Expr)\n(function bnot (Type Operand Operand) Expr)\n(function band (Type Operand Operand) Expr)\n(function bor (Type Operand Operand) Expr)\n(function PRINT (Operand Operand) Expr)\n\n;; Operand\n(function Arg (i64) Operand)\n(function Node (Body) Operand)\n(function Project (i64 Body) Operand)\n\n;; Body\n(function PureOp (Expr) Body)\n;; branching\n;; predicate (outside switch), inputs (outside switch),\n;; and for each branch a vector of outputs\n(function Gamma (Operand VecOperand VecVecOperand) Body)\n;; loops\n;; predicate (inside loop), inputs (outside loop), outputs (inside loop)\n(function Theta (Operand VecOperand VecOperand) Body)\n;; A body can also just be a VecOperand for convenience\n;; This has no corresponding node in rust, it can be\n;; removed during translation\n(function OperandGroup (VecOperand) Body)\n\n(datatype Function\n ;; name input types output types body\n (Func String FuncSigs FuncSigs VecOperand))\n\n\n;; procedure f(n):\n;; i = 0\n;; ans = 0\n;; do:\n;; ans += i*5;\n;; i += 1\n;; while(i < n);\n;; return ansm\n\n;; ;; inputs: [n]\n; (Project 0\n; (Theta\n; ; i n\n; (lt (Arg 1) (Arg 2)) ;; pred\n; (vec-of ;; inputs\n; (Node (PureOp (Const 0))) ;; accumulator\n; (Node (PureOp (Const 0))) ;; loop var\n; (Arg 0) ;; n\n; )\n; (vec-of ;; outputs\n; (Node (PureOp (add (Arg 0) ;; ans\n; (Node (PureOp (mul \n; (Arg 1) ;; i\n; (Node (PureOp (Const 5))))))))) ;; ans = i*5\n; (Node (PureOp (add (Arg 1) (Node (PureOp (Const 1)))))) ;; i += 1\n; (Arg 2) ;; n\n; ))\n; )\n\n\n\n(ruleset fast-analyses)\n\n (function VecOperand-get (VecOperand i64) Operand)\n (rule ((VO x) (> (vec-length x) 0))\n ((union (VecOperand-get (VO x) 0) (vec-get x 0)))\n :ruleset fast-analyses)\n (rule ((VecOperand-get (VO x) j)\n (= i (+ j 1)) (< i (vec-length x)))\n ((union (VecOperand-get (VO x) i) (vec-get x i)))\n :ruleset fast-analyses)\n\n (function VecOperand-length (VecOperand) i64)\n (rule ((VO x))\n ((set (VecOperand-length (VO x)) (vec-length x)))\n :ruleset fast-analyses)\n \n\n (function VecVecOperand-get (VecVecOperand i64) VecOperand)\n (rule ((VVO x) (> (vec-length x) 0))\n ((union (VecVecOperand-get (VVO x) 0) (vec-get x 0)))\n :ruleset fast-analyses)\n (rule ((VecVecOperand-get (VVO x) j)\n (= i (+ j 1)) (< i (vec-length x)))\n ((union (VecVecOperand-get (VVO x) i) (vec-get x i)))\n :ruleset fast-analyses)\n\n (function VecVecOperand-length (VecVecOperand) i64)\n (rule ((VVO x))\n ((set (VecVecOperand-length (VVO x)) (vec-length x)))\n :ruleset fast-analyses)\n \n\n (relation Expr-is-pure (Expr))\n (relation Operand-is-pure (Operand))\n (relation Body-is-pure (Body))\n (relation VecOperand-is-pure (VecOperand))\n (function VecOperand-pure-prefix (VecOperand) i64 :merge (max old new))\n (relation VecVecOperand-is-pure (VecVecOperand))\n (function VecVecOperand-pure-prefix (VecVecOperand) i64 :merge (max old new))\n (relation Function-is-pure (Function))\n \n\n (rule ((= f (Const ty ops lit)))\n ((Expr-is-pure f))\n :ruleset fast-analyses)\n\n (rule ((= f (Call ty name args n-outs))\n (Function-is-pure (Func name input-types output-types body)))\n ((Expr-is-pure f))\n :ruleset fast-analyses)\n \n\n (rule ((= f (badd type e1 e2))\n (Operand-is-pure e1)\n (Operand-is-pure e2))\n ((Expr-is-pure f))\n :ruleset fast-analyses)\n \n\n (rule ((= f (bsub type e1 e2))\n (Operand-is-pure e1)\n (Operand-is-pure e2))\n ((Expr-is-pure f))\n :ruleset fast-analyses)\n \n\n (rule ((= f (bmul type e1 e2))\n (Operand-is-pure e1)\n (Operand-is-pure e2))\n ((Expr-is-pure f))\n :ruleset fast-analyses)\n \n\n (rule ((= f (bdiv type e1 e2))\n (Operand-is-pure e1)\n (Operand-is-pure e2))\n ((Expr-is-pure f))\n :ruleset fast-analyses)\n \n\n (rule ((= f (blt type e1 e2))\n (Operand-is-pure e1)\n (Operand-is-pure e2))\n ((Expr-is-pure f))\n :ruleset fast-analyses)\n \n\n (rule ((= f (Arg x)))\n ((Operand-is-pure f))\n :ruleset fast-analyses)\n (rule ((= f (Node body))\n (Body-is-pure body))\n ((Operand-is-pure f))\n :ruleset fast-analyses)\n (rule ((= f (Project i body))\n (Body-is-pure body))\n ((Operand-is-pure f))\n :ruleset fast-analyses)\n \n\n (rule ((= f (PureOp e))\n (Expr-is-pure e))\n ((Body-is-pure f))\n :ruleset fast-analyses)\n (rule ((= f (Gamma pred inputs outputs))\n (Operand-is-pure pred)\n (VecOperand-is-pure inputs)\n (VecVecOperand-is-pure outputs))\n ((Body-is-pure f))\n :ruleset fast-analyses)\n (rule ((= f (Theta pred inputs outputs))\n (Operand-is-pure pred)\n (VecOperand-is-pure inputs)\n (VecOperand-is-pure outputs))\n ((Body-is-pure f))\n :ruleset fast-analyses)\n (rule ((= f (OperandGroup vec))\n (VecOperand-is-pure vec))\n ((Body-is-pure f))\n :ruleset fast-analyses)\n \n\n (rule ((= f (VO vec)))\n ((set (VecOperand-pure-prefix f) 0))\n :ruleset fast-analyses)\n (rule ((= i (VecOperand-pure-prefix f))\n (< i (VecOperand-length f))\n (Operand-is-pure (VecOperand-get f i)))\n ((set (VecOperand-pure-prefix f) (+ i 1)))\n :ruleset fast-analyses)\n (rule ((= (VecOperand-length f) (VecOperand-pure-prefix f)))\n ((VecOperand-is-pure f))\n :ruleset fast-analyses)\n \n\n (rule ((= f (VVO vec)))\n ((set (VecVecOperand-pure-prefix f) 0))\n :ruleset fast-analyses)\n (rule ((= i (VecVecOperand-pure-prefix f))\n (< i (VecVecOperand-length f))\n (VecOperand-is-pure (VecVecOperand-get f i)))\n ((set (VecVecOperand-pure-prefix f) (+ i 1)))\n :ruleset fast-analyses)\n (rule ((= (VecVecOperand-length f) (VecVecOperand-pure-prefix f)))\n ((VecVecOperand-is-pure f))\n :ruleset fast-analyses)\n \n\n (rule ((= f (Func name input-types output-types body))\n (VecOperand-is-pure body))\n ((Function-is-pure f))\n :ruleset fast-analyses)\n \n\n (relation Body-contains-Expr (Body i64 Expr))\n (relation Body-contains-Operand (Body i64 Operand))\n (relation Body-contains-Body (Body i64 Body))\n \n\n (rule ((= f (PureOp e)))\n ((Body-contains-Expr f 0 e))\n :ruleset fast-analyses)\n ; A Gamma only contains its outputs\n (rule ((= f (Gamma pred inputs outputs))\n (= outputs-i (VecVecOperand-get outputs i))\n (= x (VecOperand-get outputs-i j)))\n ((Body-contains-Operand f i x))\n :ruleset fast-analyses)\n ; A Theta contains its pred and outputs\n (rule ((= f (Theta pred inputs outputs)))\n ((Body-contains-Operand f -1 pred))\n :ruleset fast-analyses)\n (rule ((= f (Theta pred inputs outputs))\n (= x (VecOperand-get outputs i)))\n ((Body-contains-Operand f i x))\n :ruleset fast-analyses)\n (rule ((= f (OperandGroup vec))\n (= x (VecOperand-get vec i)))\n ((Body-contains-Operand f i x))\n :ruleset fast-analyses)\n \n\n (rule ((Body-contains-Body f i (PureOp e)))\n ((Body-contains-Expr f i e))\n :ruleset fast-analyses)\n ; A Gamma's pred and inputs are in the outer context\n (rule ((Body-contains-Body f i (Gamma pred inputs outputs)))\n ((Body-contains-Operand f i pred))\n :ruleset fast-analyses)\n (rule ((Body-contains-Body f i (Gamma pred inputs outputs))\n (= x (VecOperand-get inputs any)))\n ((Body-contains-Operand f i x))\n :ruleset fast-analyses)\n ; A Theta's inputs are in the outer context\n (rule ((Body-contains-Body f i (Theta pred inputs outputs))\n (= x (VecOperand-get inputs any)))\n ((Body-contains-Operand f i x))\n :ruleset fast-analyses)\n (rule ((Body-contains-Body f i (OperandGroup vec))\n (= x (VecOperand-get vec any)))\n ((Body-contains-Operand f i x))\n :ruleset fast-analyses)\n \n\n (rule ((Body-contains-Expr f i (Call ty name args n-outs))\n (= x (VecOperand-get args any)))\n ((Body-contains-Operand f i x))\n :ruleset fast-analyses)\n (rule ((Body-contains-Expr f i (PRINT e1 e2)))\n ((Body-contains-Operand f i e1)\n (Body-contains-Operand f i e2))\n :ruleset fast-analyses)\n \n\n (rule ((Body-contains-Expr f i (badd type e1 e2)))\n ((Body-contains-Operand f i e1)\n (Body-contains-Operand f i e2))\n :ruleset fast-analyses)\n \n\n (rule ((Body-contains-Expr f i (bsub type e1 e2)))\n ((Body-contains-Operand f i e1)\n (Body-contains-Operand f i e2))\n :ruleset fast-analyses)\n \n\n (rule ((Body-contains-Expr f i (bmul type e1 e2)))\n ((Body-contains-Operand f i e1)\n (Body-contains-Operand f i e2))\n :ruleset fast-analyses)\n \n\n (rule ((Body-contains-Expr f i (bdiv type e1 e2)))\n ((Body-contains-Operand f i e1)\n (Body-contains-Operand f i e2))\n :ruleset fast-analyses)\n \n\n (rule ((Body-contains-Expr f i (blt type e1 e2)))\n ((Body-contains-Operand f i e1)\n (Body-contains-Operand f i e2))\n :ruleset fast-analyses)\n \n\n (rule ((Body-contains-Operand f i (Node body)))\n ((Body-contains-Body f i body))\n :ruleset fast-analyses)\n (rule ((Body-contains-Operand f i (Project i body)))\n ((Body-contains-Body f i body))\n :ruleset fast-analyses)\n \n(ruleset subst) (ruleset shift)\n\n (relation can-subst-Expr-beneath (Body Expr Expr))\n (relation can-subst-Operand-beneath (Body Operand Operand))\n (relation can-subst-Body-beneath (Body Body Body))\n (relation can-subst-VecVecOperand-beneath (Body VecVecOperand VecVecOperand))\n (relation can-subst-VecOperand-beneath (Body VecOperand VecOperand))\n\n ;; Base case 'do the substitution' rules\n (rule ((can-subst-Operand-beneath above from to)\n (= above (Theta from inputs outputs)))\n ((union above (Theta to inputs outputs)))\n :ruleset subst)\n (rule ((can-subst-VecOperand-beneath above from to)\n (= above (Theta pred inputs from)))\n ((union above (Theta pred inputs to)))\n :ruleset subst)\n (rule ((can-subst-Operand-beneath above pred-from pred-to)\n (can-subst-VecOperand-beneath above outputs-from outputs-to)\n (= above (Theta pred-from inputs outputs-from)))\n ((union above (Theta pred-from inputs outputs-to)))\n :ruleset subst)\n (rule ((can-subst-VecVecOperand-beneath above from to)\n (= above (Gamma pred inputs from)))\n ((union above (Gamma pred inputs to)))\n :ruleset subst)\n (rule ((can-subst-VecOperand-beneath above from to)\n (= above (OperandGroup from)))\n ((union above (OperandGroup to)))\n :ruleset subst)\n\n ;; Learn can-subst-Operand-beneath\n (rule ((can-subst-Body-beneath above from to)\n (= new-from (Node from)))\n ((can-subst-Operand-beneath above new-from (Node to)))\n :ruleset subst)\n (rule ((can-subst-Body-beneath above from to)\n (= new-from (Project i from)))\n ((can-subst-Operand-beneath above new-from (Project i to)))\n :ruleset subst)\n\n ;; Learn can-subst-body-beneath\n (rule ((can-subst-Expr-beneath above from to)\n (= new-from (PureOp from)))\n ((can-subst-Body-beneath above new-from (PureOp to)))\n :ruleset subst)\n ;; Propagates up same context (Gamma: pred & inputs, Theta: inputs)\n ;; rtjoa: Is it sound to propagate up outputs if we renumber args?\n (rule ((can-subst-Operand-beneath above from to)\n (= new-from (Gamma from inputs outputs)))\n ((can-subst-Body-beneath above new-from (Gamma to inputs outputs)))\n :ruleset subst)\n (rule ((can-subst-VecOperand-beneath above from to)\n (= new-from (Gamma pred from outputs)))\n ((can-subst-Body-beneath above new-from (Gamma pred to outputs)))\n :ruleset subst)\n (rule ((can-subst-VecOperand-beneath above from to)\n (= new-from (Theta pred from outputs)))\n ((can-subst-Body-beneath above new-from (Theta pred to outputs)))\n :ruleset subst)\n (rule ((can-subst-VecOperand-beneath above from to)\n (= new-from (OperandGroup from)))\n ((can-subst-Body-beneath above new-from (OperandGroup to)))\n :ruleset subst)\n \n\n (rule ((can-subst-VecOperand-beneath above from to)\n (= new-from (Call ty f from n-outs)))\n ((can-subst-Expr-beneath above new-from (Call ty f to n-outs)))\n :ruleset subst)\n\n (rule ((can-subst-Operand-beneath above from to)\n (= new-from (badd type from e2)))\n ((can-subst-Expr-beneath above new-from (badd type to e2)))\n :ruleset subst)\n (rule ((can-subst-Operand-beneath above from to)\n (= new-from (badd type e1 from)))\n ((can-subst-Expr-beneath above new-from (badd type e1 to)))\n :ruleset subst)\n \n\n (rule ((can-subst-Operand-beneath above from to)\n (= new-from (bsub type from e2)))\n ((can-subst-Expr-beneath above new-from (bsub type to e2)))\n :ruleset subst)\n (rule ((can-subst-Operand-beneath above from to)\n (= new-from (bsub type e1 from)))\n ((can-subst-Expr-beneath above new-from (bsub type e1 to)))\n :ruleset subst)\n \n\n (rule ((can-subst-Operand-beneath above from to)\n (= new-from (bmul type from e2)))\n ((can-subst-Expr-beneath above new-from (bmul type to e2)))\n :ruleset subst)\n (rule ((can-subst-Operand-beneath above from to)\n (= new-from (bmul type e1 from)))\n ((can-subst-Expr-beneath above new-from (bmul type e1 to)))\n :ruleset subst)\n \n\n (rule ((can-subst-Operand-beneath above from to)\n (= new-from (bdiv type from e2)))\n ((can-subst-Expr-beneath above new-from (bdiv type to e2)))\n :ruleset subst)\n (rule ((can-subst-Operand-beneath above from to)\n (= new-from (bdiv type e1 from)))\n ((can-subst-Expr-beneath above new-from (bdiv type e1 to)))\n :ruleset subst)\n \n\n (rule ((can-subst-Operand-beneath above from to)\n (= new-from (blt type from e2)))\n ((can-subst-Expr-beneath above new-from (blt type to e2)))\n :ruleset subst)\n (rule ((can-subst-Operand-beneath above from to)\n (= new-from (blt type e1 from)))\n ((can-subst-Expr-beneath above new-from (blt type e1 to)))\n :ruleset subst)\n \n\n (rule ((can-subst-Operand-beneath above from to)\n (= from (VecOperand-get (VO vec) i)))\n ((can-subst-VecOperand-beneath\n above\n (VO vec)\n (VO (vec-set vec i to))))\n :ruleset subst)\n\n (rule ((can-subst-VecOperand-beneath above from to)\n (= from (VecVecOperand-get (VVO vec) i)))\n ((can-subst-VecVecOperand-beneath\n above\n (VVO vec)\n (VVO (vec-set vec i to))))\n :ruleset subst)\n(function SubstExpr (Expr i64 Operand) Expr :unextractable)\n(function SubstOperand (Operand i64 Operand) Operand :unextractable)\n(function SubstBody (Body i64 Operand) Body :unextractable)\n(function SubstVecOperand (VecOperand i64 Operand) VecOperand :unextractable)\n(function SubstVecVecOperand (VecVecOperand i64 Operand) VecVecOperand :unextractable)\n\n (rewrite\n (SubstExpr (badd ty a b) x0 x1)\n (badd\n ty\n (SubstOperand a x0 x1)\n (SubstOperand b x0 x1))\n :ruleset subst)\n \n\n (rewrite\n (SubstExpr (bsub ty a b) x0 x1)\n (bsub\n ty\n (SubstOperand a x0 x1)\n (SubstOperand b x0 x1))\n :ruleset subst)\n \n\n (rewrite\n (SubstExpr (bmul ty a b) x0 x1)\n (bmul\n ty\n (SubstOperand a x0 x1)\n (SubstOperand b x0 x1))\n :ruleset subst)\n \n\n (rewrite\n (SubstExpr (bdiv ty a b) x0 x1)\n (bdiv\n ty\n (SubstOperand a x0 x1)\n (SubstOperand b x0 x1))\n :ruleset subst)\n \n\n (rewrite\n (SubstExpr (blt ty a b) x0 x1)\n (blt\n ty\n (SubstOperand a x0 x1)\n (SubstOperand b x0 x1))\n :ruleset subst)\n \n\n (rewrite\n (SubstExpr (Const ty ops lit) x0 x1)\n (Const ty ops lit)\n :ruleset subst)\n (rewrite\n (SubstExpr (Call ty f args n-outs) x0 x1)\n (Call ty f (SubstVecOperand args x0 x1) n-outs)\n :ruleset subst)\n (rewrite\n (SubstExpr (PRINT a b) x0 x1)\n (PRINT (SubstOperand a x0 x1) (SubstOperand b x0 x1))\n :ruleset subst)\n\n (rewrite (SubstOperand (Arg x) x v) v :ruleset subst)\n (rule ((= f (SubstOperand (Arg y) x v)) (!= y x))\n ((union f (Arg y))) :ruleset subst)\n\n (rewrite\n (SubstOperand (Node b) x0 x1)\n (Node (SubstBody b x0 x1))\n :ruleset subst)\n (rewrite\n (SubstOperand (Project i b) x0 x1)\n (Project i (SubstBody b x0 x1))\n :ruleset subst)\n\n (rewrite\n (SubstBody (PureOp e) x0 x1)\n (PureOp (SubstExpr e x0 x1))\n :ruleset subst)\n ;; Don't cross regions, so so we shift into the inputs but not outputs\n ;; A Gamma's pred is on the outside, so it's affected, but not a Theta's\n (rewrite\n (SubstBody (Gamma pred inputs outputs) x0 x1)\n (Gamma\n (SubstOperand pred x0 x1)\n (SubstVecOperand inputs x0 x1)\n outputs)\n :ruleset subst)\n (rewrite\n (SubstBody (Theta pred inputs outputs) x0 x1)\n (Theta pred (SubstVecOperand inputs x0 x1) outputs)\n :ruleset subst)\n\n (function SubstVecOperand-helper (VecOperand i64 Operand i64) VecOperand)\n (rewrite\n (SubstVecOperand vec x0 x1)\n (SubstVecOperand-helper vec x0 x1 0)\n :ruleset subst)\n (rule\n ((= f (SubstVecOperand-helper (VO vec) x0 x1 i))\n (< i (vec-length vec)))\n ((union\n (SubstVecOperand-helper (VO vec) x0 x1 i)\n (SubstVecOperand-helper\n (VO (vec-set vec i (SubstOperand (vec-get vec i) x0 x1)))\n x0 x1 (+ i 1))))\n :ruleset subst)\n (rule\n ((= f (SubstVecOperand-helper (VO vec) x0 x1 i))\n (= i (vec-length vec)))\n ((union\n (SubstVecOperand-helper (VO vec) x0 x1 i)\n (VO vec)))\n :ruleset subst)\n\n (function SubstVecVecOperand-helper (VecVecOperand i64 Operand i64) VecVecOperand)\n (rewrite\n (SubstVecVecOperand vec x0 x1)\n (SubstVecVecOperand-helper vec x0 x1 0)\n :ruleset subst)\n (rule\n ((= f (SubstVecVecOperand-helper (VVO vec) x0 x1 i))\n (< i (vec-length vec)))\n ((union\n (SubstVecVecOperand-helper (VVO vec) x0 x1 i)\n (SubstVecVecOperand-helper\n (VVO (vec-set vec i (SubstVecOperand (vec-get vec i) x0 x1)))\n x0 x1 (+ i 1))))\n :ruleset subst)\n (rule\n ((= f (SubstVecVecOperand-helper (VVO vec) x0 x1 i))\n (= i (vec-length vec)))\n ((union\n (SubstVecVecOperand-helper (VVO vec) x0 x1 i)\n (VVO vec)))\n :ruleset subst)\n(function SubstExprAll (Expr VecOperand) Expr :unextractable)\n(function SubstOperandAll (Operand VecOperand) Operand :unextractable)\n(function SubstBodyAll (Body VecOperand) Body :unextractable)\n(function SubstVecOperandAll (VecOperand VecOperand) VecOperand :unextractable)\n(function SubstVecVecOperandAll (VecVecOperand VecOperand) VecVecOperand :unextractable)\n\n (rewrite\n (SubstExprAll (badd ty a b) x0)\n (badd\n ty\n (SubstOperandAll a x0)\n (SubstOperandAll b x0))\n :ruleset subst)\n \n\n (rewrite\n (SubstExprAll (bsub ty a b) x0)\n (bsub\n ty\n (SubstOperandAll a x0)\n (SubstOperandAll b x0))\n :ruleset subst)\n \n\n (rewrite\n (SubstExprAll (bmul ty a b) x0)\n (bmul\n ty\n (SubstOperandAll a x0)\n (SubstOperandAll b x0))\n :ruleset subst)\n \n\n (rewrite\n (SubstExprAll (bdiv ty a b) x0)\n (bdiv\n ty\n (SubstOperandAll a x0)\n (SubstOperandAll b x0))\n :ruleset subst)\n \n\n (rewrite\n (SubstExprAll (blt ty a b) x0)\n (blt\n ty\n (SubstOperandAll a x0)\n (SubstOperandAll b x0))\n :ruleset subst)\n \n\n (rewrite\n (SubstExprAll (Const ty ops lit) x0)\n (Const ty ops lit)\n :ruleset subst)\n (rewrite\n (SubstExprAll (Call ty f args n-outs) x0)\n (Call ty f (SubstVecOperandAll args x0) n-outs)\n :ruleset subst)\n (rewrite\n (SubstExprAll (PRINT a b) x0)\n (PRINT (SubstOperandAll a x0) (SubstOperandAll b x0))\n :ruleset subst)\n\n (rule ((= f (SubstOperandAll (Arg x) (VO ops)))\n (< x (vec-length ops)))\n ((union f (vec-get ops x))) :ruleset subst)\n\n (rewrite\n (SubstOperandAll (Node b) x0)\n (Node (SubstBodyAll b x0))\n :ruleset subst)\n (rewrite\n (SubstOperandAll (Project i b) x0)\n (Project i (SubstBodyAll b x0))\n :ruleset subst)\n\n (rewrite\n (SubstBodyAll (PureOp e) x0)\n (PureOp (SubstExprAll e x0))\n :ruleset subst)\n ;; Don't cross regions, so so we shift into the inputs but not outputs\n ;; A Gamma's pred is on the outside, so it's affected, but not a Theta's\n (rewrite\n (SubstBodyAll (Gamma pred inputs outputs) x0)\n (Gamma\n (SubstOperandAll pred x0)\n (SubstVecOperandAll inputs x0)\n outputs)\n :ruleset subst)\n (rewrite\n (SubstBodyAll (Theta pred inputs outputs) x0)\n (Theta pred (SubstVecOperandAll inputs x0) outputs)\n :ruleset subst)\n\n (function SubstVecOperandAll-helper (VecOperand VecOperand i64) VecOperand)\n (rewrite\n (SubstVecOperandAll vec x0)\n (SubstVecOperandAll-helper vec x0 0)\n :ruleset subst)\n (rule\n ((= f (SubstVecOperandAll-helper (VO vec) x0 i))\n (< i (vec-length vec)))\n ((union\n (SubstVecOperandAll-helper (VO vec) x0 i)\n (SubstVecOperandAll-helper\n (VO (vec-set vec i (SubstOperandAll (vec-get vec i) x0)))\n x0 (+ i 1))))\n :ruleset subst)\n (rule\n ((= f (SubstVecOperandAll-helper (VO vec) x0 i))\n (= i (vec-length vec)))\n ((union\n (SubstVecOperandAll-helper (VO vec) x0 i)\n (VO vec)))\n :ruleset subst)\n\n (function SubstVecVecOperandAll-helper (VecVecOperand VecOperand i64) VecVecOperand)\n (rewrite\n (SubstVecVecOperandAll vec x0)\n (SubstVecVecOperandAll-helper vec x0 0)\n :ruleset subst)\n (rule\n ((= f (SubstVecVecOperandAll-helper (VVO vec) x0 i))\n (< i (vec-length vec)))\n ((union\n (SubstVecVecOperandAll-helper (VVO vec) x0 i)\n (SubstVecVecOperandAll-helper\n (VVO (vec-set vec i (SubstVecOperandAll (vec-get vec i) x0)))\n x0 (+ i 1))))\n :ruleset subst)\n (rule\n ((= f (SubstVecVecOperandAll-helper (VVO vec) x0 i))\n (= i (vec-length vec)))\n ((union\n (SubstVecVecOperandAll-helper (VVO vec) x0 i)\n (VVO vec)))\n :ruleset subst)\n(function ShiftExpr (Expr i64 i64) Expr :unextractable)\n(function ShiftOperand (Operand i64 i64) Operand :unextractable)\n(function ShiftBody (Body i64 i64) Body :unextractable)\n(function ShiftVecOperand (VecOperand i64 i64) VecOperand :unextractable)\n(function ShiftVecVecOperand (VecVecOperand i64 i64) VecVecOperand :unextractable)\n\n (rewrite\n (ShiftExpr (badd ty a b) x0 x1)\n (badd\n ty\n (ShiftOperand a x0 x1)\n (ShiftOperand b x0 x1))\n :ruleset shift)\n \n\n (rewrite\n (ShiftExpr (bsub ty a b) x0 x1)\n (bsub\n ty\n (ShiftOperand a x0 x1)\n (ShiftOperand b x0 x1))\n :ruleset shift)\n \n\n (rewrite\n (ShiftExpr (bmul ty a b) x0 x1)\n (bmul\n ty\n (ShiftOperand a x0 x1)\n (ShiftOperand b x0 x1))\n :ruleset shift)\n \n\n (rewrite\n (ShiftExpr (bdiv ty a b) x0 x1)\n (bdiv\n ty\n (ShiftOperand a x0 x1)\n (ShiftOperand b x0 x1))\n :ruleset shift)\n \n\n (rewrite\n (ShiftExpr (blt ty a b) x0 x1)\n (blt\n ty\n (ShiftOperand a x0 x1)\n (ShiftOperand b x0 x1))\n :ruleset shift)\n \n\n (rewrite\n (ShiftExpr (Const ty ops lit) x0 x1)\n (Const ty ops lit)\n :ruleset shift)\n (rewrite\n (ShiftExpr (Call ty f args n-outs) x0 x1)\n (Call ty f (ShiftVecOperand args x0 x1) n-outs)\n :ruleset shift)\n (rewrite\n (ShiftExpr (PRINT a b) x0 x1)\n (PRINT (ShiftOperand a x0 x1) (ShiftOperand b x0 x1))\n :ruleset shift)\n\n (rule ((= f (ShiftOperand (Arg x) last-unshifted amt)) (<= x last-unshifted))\n ((union f (Arg x))) :ruleset shift)\n (rule ((= f (ShiftOperand (Arg x) last-unshifted amt)) (> x last-unshifted))\n ((union f (Arg (+ x amt)))) :ruleset shift)\n\n (rewrite\n (ShiftOperand (Node b) x0 x1)\n (Node (ShiftBody b x0 x1))\n :ruleset shift)\n (rewrite\n (ShiftOperand (Project i b) x0 x1)\n (Project i (ShiftBody b x0 x1))\n :ruleset shift)\n\n (rewrite\n (ShiftBody (PureOp e) x0 x1)\n (PureOp (ShiftExpr e x0 x1))\n :ruleset shift)\n ;; Don't cross regions, so so we shift into the inputs but not outputs\n ;; A Gamma's pred is on the outside, so it's affected, but not a Theta's\n (rewrite\n (ShiftBody (Gamma pred inputs outputs) x0 x1)\n (Gamma\n (ShiftOperand pred x0 x1)\n (ShiftVecOperand inputs x0 x1)\n outputs)\n :ruleset shift)\n (rewrite\n (ShiftBody (Theta pred inputs outputs) x0 x1)\n (Theta pred (ShiftVecOperand inputs x0 x1) outputs)\n :ruleset shift)\n\n (function ShiftVecOperand-helper (VecOperand i64 i64 i64) VecOperand)\n (rewrite\n (ShiftVecOperand vec x0 x1)\n (ShiftVecOperand-helper vec x0 x1 0)\n :ruleset shift)\n (rule\n ((= f (ShiftVecOperand-helper (VO vec) x0 x1 i))\n (< i (vec-length vec)))\n ((union\n (ShiftVecOperand-helper (VO vec) x0 x1 i)\n (ShiftVecOperand-helper\n (VO (vec-set vec i (ShiftOperand (vec-get vec i) x0 x1)))\n x0 x1 (+ i 1))))\n :ruleset shift)\n (rule\n ((= f (ShiftVecOperand-helper (VO vec) x0 x1 i))\n (= i (vec-length vec)))\n ((union\n (ShiftVecOperand-helper (VO vec) x0 x1 i)\n (VO vec)))\n :ruleset shift)\n\n (function ShiftVecVecOperand-helper (VecVecOperand i64 i64 i64) VecVecOperand)\n (rewrite\n (ShiftVecVecOperand vec x0 x1)\n (ShiftVecVecOperand-helper vec x0 x1 0)\n :ruleset shift)\n (rule\n ((= f (ShiftVecVecOperand-helper (VVO vec) x0 x1 i))\n (< i (vec-length vec)))\n ((union\n (ShiftVecVecOperand-helper (VVO vec) x0 x1 i)\n (ShiftVecVecOperand-helper\n (VVO (vec-set vec i (ShiftVecOperand (vec-get vec i) x0 x1)))\n x0 x1 (+ i 1))))\n :ruleset shift)\n (rule\n ((= f (ShiftVecVecOperand-helper (VVO vec) x0 x1 i))\n (= i (vec-length vec)))\n ((union\n (ShiftVecVecOperand-helper (VVO vec) x0 x1 i)\n (VVO vec)))\n :ruleset shift)\n;; ####################################\n;; implementation of PassThroughArguments\n;; Creates a vec of arguments\n;; (vec-of (Arg 0) (Arg 1) ...) with length i\n(function PassThroughArguments (i64) VecOperand :unextractable)\n\n\n\n;; (how many arguments to generate, vector so far)\n(function PassThroughArgumentsHelper (i64 VecOperand) VecOperand :unextractable)\n\n(rewrite (PassThroughArguments i)\n (PassThroughArgumentsHelper i (VO (vec-of)))\n :ruleset subst)\n\n(rule ((= lhs (PassThroughArgumentsHelper i (VO rest)))\n (< (vec-length rest) i))\n ((union lhs\n (PassThroughArgumentsHelper i\n (VO (vec-push rest (Arg (vec-length rest)))))))\n :ruleset subst)\n\n(rule ((= lhs (PassThroughArgumentsHelper i (VO rest)))\n (= (vec-length rest) i))\n ((union lhs (VO rest)))\n :ruleset subst)\n\n\n\n;; Project each argument out of a body\n(function BodyToVecOperand (i64 Body) VecOperand :unextractable)\n;; current index, body length, body, and vector so far\n(function BodyToVecOperandHelper (i64 i64 Body VecOperandBase) VecOperand :unextractable)\n\n(rewrite (BodyToVecOperand body-len body)\n (BodyToVecOperandHelper 0 body-len body (vec-of)))\n(rule\n ((= helper (BodyToVecOperandHelper index body-len body so-far))\n (< index body-len))\n ((union helper\n (BodyToVecOperandHelper (+ index 1) body-len body\n (vec-push so-far \n (Project index body)))))\n :ruleset subst)\n\n(rule\n ((= helper (BodyToVecOperandHelper index body-len body so-far))\n (= index body-len))\n ((union helper (VO so-far)))\n :ruleset subst)\n\n\n\n;; constant_fold.rs adds most constant folding operations\n;; this file is for special cases\n\n\n;; eliminate gamma nodes for true and false cases\n(rule ((= gamma\n ;; gamma predicate is true\n (Gamma (Node (PureOp (Const (BoolT) (const) (Bool true))))\n inputs\n (VVO outputs))))\n (\n ;; replace use of the gamma with\n ;; the true case\n (union\n gamma\n (OperandGroup\n (SubstVecOperandAll\n (vec-get outputs 1)\n inputs)))))\n\n\n\n(rule ((= gamma\n ;; gamma predicate is false\n (Gamma (Node (PureOp (Const (BoolT) (const) (Bool false))))\n inputs\n (VVO outputs))))\n (\n ;; replace use of the gamma with\n ;; the false case\n (union\n gamma\n (OperandGroup\n (SubstVecOperandAll (vec-get outputs 0) inputs)))))\n\n;; Eliminate theta\n;; Unroll one layer and get rid of loop\n(rule ((= theta\n ;; gamma predicate is false\n (Theta (Node (PureOp (Const (BoolT) (const) (Bool false))))\n (VO inputs)\n (VO outputs))))\n ((let after-one-iter (SubstVecOperandAll (VO outputs) (VO inputs)))\n (union theta\n (OperandGroup after-one-iter))))\n\n\n\n\n\n(rewrite (badd output_type\n (Node (PureOp (Const ty2 (const) (Num n1))))\n (Node (PureOp (Const ty3 (const) (Num n2)))))\n (Const output_type (const) (Num (+ n1 n2))))\n(rewrite (bsub output_type\n (Node (PureOp (Const ty2 (const) (Num n1))))\n (Node (PureOp (Const ty3 (const) (Num n2)))))\n (Const output_type (const) (Num (- n1 n2))))\n(rewrite (bmul output_type\n (Node (PureOp (Const ty2 (const) (Num n1))))\n (Node (PureOp (Const ty3 (const) (Num n2)))))\n (Const output_type (const) (Num (* n1 n2))))\n(rewrite (bdiv output_type\n (Node (PureOp (Const ty2 (const) (Num n1))))\n (Node (PureOp (Const ty3 (const) (Num n2)))))\n (Const output_type (const) (Num (/ n1 n2))))\n(rewrite (blt output_type\n (Node (PureOp (Const ty2 (const) (Num n1))))\n (Node (PureOp (Const ty3 (const) (Num n2)))))\n (Const output_type (const) (Bool (bool-< n1 n2))))\n(sort TermAndCost)\n(function Smaller (TermAndCost TermAndCost) TermAndCost)\n\n;; manual, bottom-up extraction of terms using this function\n(function ExtractedExpr (Expr) TermAndCost\n :merge (Smaller old new))\n;; Store a term and its cost for this type\n(function ExprAndCost (Expr i64) TermAndCost)\n\n;; Perform smaller using the next two rules\n(rule ((= lhs (Smaller (ExprAndCost t1 cost1)\n (ExprAndCost t2 cost2)))\n (<= cost1 cost2))\n ((union lhs (ExprAndCost t1 cost1)))\n :ruleset fast-analyses)\n \n(rule ((= lhs (Smaller (ExprAndCost t1 cost1)\n (ExprAndCost t2 cost2)))\n (> cost1 cost2))\n ((union lhs (ExprAndCost t2 cost2)))\n :ruleset fast-analyses)\n\n\n;; manual, bottom-up extraction of terms using this function\n(function ExtractedOperand (Operand) TermAndCost\n :merge (Smaller old new))\n;; Store a term and its cost for this type\n(function OperandAndCost (Operand i64) TermAndCost)\n\n;; Perform smaller using the next two rules\n(rule ((= lhs (Smaller (OperandAndCost t1 cost1)\n (OperandAndCost t2 cost2)))\n (<= cost1 cost2))\n ((union lhs (OperandAndCost t1 cost1)))\n :ruleset fast-analyses)\n \n(rule ((= lhs (Smaller (OperandAndCost t1 cost1)\n (OperandAndCost t2 cost2)))\n (> cost1 cost2))\n ((union lhs (OperandAndCost t2 cost2)))\n :ruleset fast-analyses)\n\n\n;; manual, bottom-up extraction of terms using this function\n(function ExtractedBody (Body) TermAndCost\n :merge (Smaller old new))\n;; Store a term and its cost for this type\n(function BodyAndCost (Body i64) TermAndCost)\n\n;; Perform smaller using the next two rules\n(rule ((= lhs (Smaller (BodyAndCost t1 cost1)\n (BodyAndCost t2 cost2)))\n (<= cost1 cost2))\n ((union lhs (BodyAndCost t1 cost1)))\n :ruleset fast-analyses)\n \n(rule ((= lhs (Smaller (BodyAndCost t1 cost1)\n (BodyAndCost t2 cost2)))\n (> cost1 cost2))\n ((union lhs (BodyAndCost t2 cost2)))\n :ruleset fast-analyses)\n\n\n;; manual, bottom-up extraction of terms using this function\n(function ExtractedVecOperand (VecOperand) TermAndCost\n :merge (Smaller old new))\n;; Store a term and its cost for this type\n(function VecOperandAndCost (VecOperand i64) TermAndCost)\n\n;; Perform smaller using the next two rules\n(rule ((= lhs (Smaller (VecOperandAndCost t1 cost1)\n (VecOperandAndCost t2 cost2)))\n (<= cost1 cost2))\n ((union lhs (VecOperandAndCost t1 cost1)))\n :ruleset fast-analyses)\n \n(rule ((= lhs (Smaller (VecOperandAndCost t1 cost1)\n (VecOperandAndCost t2 cost2)))\n (> cost1 cost2))\n ((union lhs (VecOperandAndCost t2 cost2)))\n :ruleset fast-analyses)\n\n\n;; manual, bottom-up extraction of terms using this function\n(function ExtractedVecVecOperand (VecVecOperand) TermAndCost\n :merge (Smaller old new))\n;; Store a term and its cost for this type\n(function VecVecOperandAndCost (VecVecOperand i64) TermAndCost)\n\n;; Perform smaller using the next two rules\n(rule ((= lhs (Smaller (VecVecOperandAndCost t1 cost1)\n (VecVecOperandAndCost t2 cost2)))\n (<= cost1 cost2))\n ((union lhs (VecVecOperandAndCost t1 cost1)))\n :ruleset fast-analyses)\n \n(rule ((= lhs (Smaller (VecVecOperandAndCost t1 cost1)\n (VecVecOperandAndCost t2 cost2)))\n (> cost1 cost2))\n ((union lhs (VecVecOperandAndCost t2 cost2)))\n :ruleset fast-analyses)\n\n\n(rule ((= lhs (badd ty a b))\n (= (OperandAndCost expr1 cost1) (ExtractedOperand a))\n (= (OperandAndCost expr2 cost2) (ExtractedOperand b)))\n ((set (ExtractedExpr lhs)\n (ExprAndCost (badd ty expr1 expr2)\n (+ 1 (+ cost1 cost2)))))\n :ruleset fast-analyses)\n\n\n(rule ((= lhs (bsub ty a b))\n (= (OperandAndCost expr1 cost1) (ExtractedOperand a))\n (= (OperandAndCost expr2 cost2) (ExtractedOperand b)))\n ((set (ExtractedExpr lhs)\n (ExprAndCost (bsub ty expr1 expr2)\n (+ 1 (+ cost1 cost2)))))\n :ruleset fast-analyses)\n\n\n(rule ((= lhs (bmul ty a b))\n (= (OperandAndCost expr1 cost1) (ExtractedOperand a))\n (= (OperandAndCost expr2 cost2) (ExtractedOperand b)))\n ((set (ExtractedExpr lhs)\n (ExprAndCost (bmul ty expr1 expr2)\n (+ 1 (+ cost1 cost2)))))\n :ruleset fast-analyses)\n\n\n(rule ((= lhs (bdiv ty a b))\n (= (OperandAndCost expr1 cost1) (ExtractedOperand a))\n (= (OperandAndCost expr2 cost2) (ExtractedOperand b)))\n ((set (ExtractedExpr lhs)\n (ExprAndCost (bdiv ty expr1 expr2)\n (+ 1 (+ cost1 cost2)))))\n :ruleset fast-analyses)\n\n\n(rule ((= lhs (blt ty a b))\n (= (OperandAndCost expr1 cost1) (ExtractedOperand a))\n (= (OperandAndCost expr2 cost2) (ExtractedOperand b)))\n ((set (ExtractedExpr lhs)\n (ExprAndCost (blt ty expr1 expr2)\n (+ 1 (+ cost1 cost2)))))\n :ruleset fast-analyses)\n\n\n(rule ((= lhs (PRINT a b))\n (= (OperandAndCost expr1 cost1) (ExtractedOperand a))\n (= (OperandAndCost expr2 cost2) (ExtractedOperand b)))\n ((set (ExtractedExpr lhs)\n (ExprAndCost (PRINT expr1 expr2)\n (+ 1 (+ cost1 cost2)))))\n :ruleset fast-analyses)\n\n;; TODO fix this HACK\n;; this is how we get an empty vector of vectors in egglog because of\n;; typechecking bug in egglog https://github.com/egraphs-good/egglog/issues/113\n(let empty-vvo \n (vec-pop (vec-of (VO (vec-of)))))\n\n\n(function ExtractedVecOperandHelper (VecOperand i64) TermAndCost :merge (Smaller old new))\n\n;; base case: extract nothing\n(rule\n ((VO vec))\n ((set (ExtractedVecOperandHelper (VO vec) 0)\n (VecOperandAndCost (VO (vec-of)) 0)))\n :ruleset fast-analyses)\n\n;; extract one more thing\n(rule\n ((= (VecOperandAndCost (VO current) current-cost)\n (ExtractedVecOperandHelper (VO vec) index))\n (< index (vec-length vec))\n (= (ExtractedOperand (VecOperand-get (VO vec) index)) (OperandAndCost expr expr-cost)))\n ((set (ExtractedVecOperandHelper (VO vec) (+ index 1))\n (VecOperandAndCost\n (VO (vec-push current expr))\n (+ current-cost expr-cost))))\n :ruleset fast-analyses)\n \n\n \n;; finished extracting, create result\n(rule\n ((= result\n (ExtractedVecOperandHelper (VO vec) index))\n ;; at the end\n (= index (vec-length vec)))\n ((set (ExtractedVecOperand (VO vec))\n result))\n :ruleset fast-analyses)\n \n\n(function ExtractedVecVecOperandHelper (VecVecOperand i64) TermAndCost :merge (Smaller old new))\n\n;; base case: extract nothing\n(rule\n ((VVO vec))\n ((set (ExtractedVecVecOperandHelper (VVO vec) 0)\n (VecVecOperandAndCost (VVO empty-vvo) 0)))\n :ruleset fast-analyses)\n\n;; extract one more thing\n(rule\n ((= (VecVecOperandAndCost (VVO current) current-cost)\n (ExtractedVecVecOperandHelper (VVO vec) index))\n (< index (vec-length vec))\n (= (ExtractedVecOperand (VecVecOperand-get (VVO vec) index)) (VecOperandAndCost expr expr-cost)))\n ((set (ExtractedVecVecOperandHelper (VVO vec) (+ index 1))\n (VecVecOperandAndCost\n (VVO (vec-push current expr))\n (+ current-cost expr-cost))))\n :ruleset fast-analyses)\n \n\n \n;; finished extracting, create result\n(rule\n ((= result\n (ExtractedVecVecOperandHelper (VVO vec) index))\n ;; at the end\n (= index (vec-length vec)))\n ((set (ExtractedVecVecOperand (VVO vec))\n result))\n :ruleset fast-analyses)\n \n\n;; Constant gets cost of 1\n(rule\n ((= lhs (Const ty ops lit)))\n ((set (ExtractedExpr lhs) (ExprAndCost lhs 1)))\n :ruleset fast-analyses)\n\n;; arg gets cost of 1\n(rule\n ((= lhs (Arg index)))\n ((set (ExtractedOperand lhs) (OperandAndCost lhs 1)))\n :ruleset fast-analyses)\n\n\n;; PureOp doesn't add cost\n(rule\n ((= lhs (PureOp expr))\n (= (ExprAndCost expr-extracted expr-cost)\n (ExtractedExpr expr)))\n ((set (ExtractedBody lhs) (BodyAndCost (PureOp expr-extracted) expr-cost)))\n :ruleset fast-analyses)\n\n;; Nor does Node\n(rule\n ((= lhs (Node body))\n (= (BodyAndCost body-extracted body-cost)\n (ExtractedBody body)))\n ((set (ExtractedOperand lhs) (OperandAndCost (Node body-extracted) body-cost)))\n :ruleset fast-analyses)\n\n;; Theta gets a cost of 1 for now\n(rule\n ((= lhs (Theta pred inputs outputs))\n (= (OperandAndCost pred-extracted pred-cost)\n (ExtractedOperand pred))\n (= (VecOperandAndCost inputs-extracted inputs-cost)\n (ExtractedVecOperand inputs))\n (= (VecOperandAndCost outputs-extracted outputs-cost)\n (ExtractedVecOperand outputs)))\n ((set (ExtractedBody lhs)\n (BodyAndCost\n (Theta pred-extracted inputs-extracted outputs-extracted)\n (+ 1 (+ pred-cost (+ inputs-cost outputs-cost))))))\n :ruleset fast-analyses)\n\n;; Gamma gets a cost of 1 for now\n(rule\n ((= lhs (Gamma pred inputs outputs))\n (= (OperandAndCost pred-extracted pred-cost)\n (ExtractedOperand pred))\n (= (VecOperandAndCost inputs-extracted inputs-cost)\n (ExtractedVecOperand inputs))\n (= (VecVecOperandAndCost outputs-extracted outputs-cost)\n (ExtractedVecVecOperand outputs)))\n ((set (ExtractedBody lhs)\n (BodyAndCost\n (Gamma pred-extracted inputs-extracted outputs-extracted)\n (+ 1 (+ pred-cost (+ inputs-cost outputs-cost))))))\n :ruleset fast-analyses)\n\n\n;; Project is also free\n(rule ((= lhs (Project index body))\n (= (BodyAndCost body-extracted body-cost)\n (ExtractedBody body)))\n ((set (ExtractedOperand lhs)\n (OperandAndCost (Project index body-extracted) body-cost)))\n :ruleset fast-analyses)\n \n\n\n;; If a theta passes along argument,\n;; can extract the input instead.\n(rule ((= lhs (Project index loop))\n (= loop (Theta pred inputs outputs))\n (= (VecOperand-get outputs index) (Arg index))\n (= passedthrough (ExtractedOperand (VecOperand-get inputs index)))\n )\n ((set (ExtractedOperand lhs) passedthrough))\n :ruleset fast-analyses)\n\n;; If a gamma passes along an argument in both branches,\n;; extract the input instead.\n(rule ((= lhs (Project index loop))\n (= loop (Gamma pred inputs outputs))\n (= outputs (VVO outputs-inner))\n (= 2 (vec-length outputs-inner))\n (= outputs0 (VecVecOperand-get outputs 0))\n (= outputs1 (VecVecOperand-get outputs 1))\n (= (VecOperand-get outputs0 index) (Arg index))\n (= (VecOperand-get outputs1 index) (Arg index))\n (= passedthrough (ExtractedOperand (VecOperand-get inputs index))))\n ((set (ExtractedOperand lhs) passedthrough))\n :ruleset fast-analyses)\n\n\n;; if we reach a new context, union\n(rule ((= theta (Theta pred inputs outputs))\n (= (BodyAndCost extracted cost)\n (ExtractedBody theta)))\n ((union theta extracted))\n :ruleset fast-analyses)\n(rule ((= gamma (Gamma pred inputs outputs))\n (= (BodyAndCost extracted cost)\n (ExtractedBody gamma)))\n ((union gamma extracted))\n :ruleset fast-analyses)\n\n\n;; if we reach the function at the top level, union\n(rule ((= func (Func name intypes outtypes body))\n (= (VecOperandAndCost extracted cost)\n (ExtractedVecOperand body)))\n ((union func\n (Func name intypes outtypes extracted)))\n :ruleset fast-analyses)\n \n;;\tif a && b:\n;;\t\tA\n;;\telse:\n;;\t\tB\n;; ----------\n;;\tif a:\n;;\t\tif b:\n;;\t\t\tA\n;;\t\telse:\n;;\t\t\tB\n;;\telse:\n;;\t\tB\n(rule ((= gamma (Gamma (Node (PureOp (band BoolT a b))) (VO inputs) (VVO outputs)))\n (= (vec-length outputs) 2)\n (= (vec-get outputs 1) (VO A))\n (= (vec-get outputs 0) (VO B))\n (= args (vec-length inputs))\n (= rets (vec-length B)))\n ((let inner (Gamma (Arg args) ; we pass b as an extra argument to the outer gamma\n (PassThroughArguments args)\n (VVO (vec-of (VO B)\n (VO A)))))\n (union gamma (Gamma a\n (VO (vec-push inputs b)) ; pass b as an extra argument\n (VVO (vec-of (VO B)\n (BodyToVecOperand rets inner)))))))\n\n;;\tif a || b:\n;;\t\tA\n;;\telse:\n;;\t\tB\n;; -----------\n;;\tif a:\n;;\t\tA\n;;\telse:\n;;\t\tif b:\n;;\t\t\tA\n;;\t\telse:\n;;\t\t\tB\n(rule ((= gamma (Gamma (Node (PureOp (bor BoolT a b))) (VO inputs) (VVO outputs)))\n (= (vec-length outputs) 2)\n (= (vec-get outputs 1) (VO A))\n (= (vec-get outputs 0) (VO B))\n (= args (vec-length inputs))\n (= rets (vec-length B)))\n ((let inner (Gamma (Arg args) ; we pass b as an extra argument to the outer gamma\n (PassThroughArguments args)\n (VVO (vec-of (VO B)\n (VO A)))))\n (union gamma (Gamma a\n (VO (vec-push inputs b)) ; pass b as an extra argument\n (VVO (vec-of (BodyToVecOperand rets inner)\n (VO A)))))))\n\n;;\tif a:\n;;\t\tA\n;;\telse:\n;;\t\tA\n;; ------\n;;\tA\n(rule ((= gamma (Gamma condition inputs (VVO outputs)))\n (= (vec-length outputs) 2)\n (= (vec-get outputs 0) (vec-get outputs 1)))\n ((union gamma (OperandGroup (SubstVecOperandAll (vec-get outputs 0) inputs)))))\n\n\n;; unroll loops\n(rule ((= theta (Theta pred (VO inputs) (VO outputs))))\n ;; arguments body\n ((let after-one-iter\n (SubstVecOperandAll (VO outputs) (VO inputs)))\n ;; (vec-of (Arg 0) (Arg 1) ...)\n (let pass-through (PassThroughArguments (vec-length outputs)))\n (union theta\n (Gamma\n (SubstOperandAll pred after-one-iter)\n after-one-iter\n (VVO\n (vec-of\n ;; in the false case, we are done\n pass-through\n ;; otherwise do the rest of the loop\n (BodyToVecOperand\n (vec-length outputs)\n (Theta pred pass-through\n (VO outputs)))))))))\n\n\n\n(datatype Interval\n (BoolI bool bool)\n (IntI i64 i64)\n (interval-intersect Interval Interval)\n (interval-union Interval Interval))\n\n\n(rewrite (interval-intersect (IntI la ha) (IntI lb hb))\n (IntI (max la lb) (min ha hb)))\n(rewrite (interval-union (IntI la ha) (IntI lb hb))\n (IntI (min la lb) (max ha hb)))\n\n(rewrite (interval-intersect (BoolI la ha) (BoolI lb hb))\n (BoolI (or la lb) (and ha hb)))\n(rewrite (interval-union (BoolI la ha) (BoolI lb hb))\n (BoolI (and la lb) (or ha hb)))\n\n(function ival (Operand) Interval\n :merge (interval-intersect old new))\n\n; context-specific intervals (because Args need to have interval analysis but are not globally unique)\n(function context-ival (Operand Body) Interval\n :merge (interval-intersect old new))\n\n(rule ((= lhs (Node (PureOp (Const (BoolT) (const) (Bool b))))))\n ((set (ival lhs) (BoolI b b))))\n\n(rule ((= lhs (Node (PureOp (Const (IntT) (const) (Num n))))))\n ((set (ival lhs) (IntI n n))))\n\n\n; < a b interval (< ha lb) (< la hb)\n(rule ((= lhs (Node (PureOp (blt (BoolT) a b))))\n (= (IntI la ha) (ival a))\n (= (IntI lb hb) (ival b)))\n ((set (ival lhs) (BoolI (bool-< ha lb) (bool-< la hb)))))\n\n; Rule that unions intervals for a gamma\n(rule (\n (= lhs (Project i (Gamma pred ins (VVO outs))))\n (= (VO thens) (vec-get outs 1))\n (= (VO elses) (vec-get outs 0))\n (= thenival (ival (vec-get thens i)))\n (= elseival (ival (vec-get elses i)))\n )\n (\n (set (ival lhs) (interval-union thenival elseival))\n )\n)\n\n; Eliminate gamma with interval analysis\n(rule (\n (= gamma (Gamma pred inputs (VVO outputs)))\n (= (BoolI true true) (ival pred))\n )\n (\n (union gamma (OperandGroup (SubstVecOperandAll (vec-get outputs 1) inputs)))\n )\n)\n(rule (\n (= gamma (Gamma pred inputs (VVO outputs)))\n (= (BoolI false false) (ival pred))\n )\n (\n (union gamma (OperandGroup (SubstVecOperandAll (vec-get outputs 0) inputs)))\n )\n)\n\n(rule \n (\n ; Match on PureOp because all exprs are converted to bodies\n ; Will refactor Call in the future\n (= return (PureOp (Call ty name args num)) )\n (Func name input-types output-types body)\n )\n ((\n union \n return\n (OperandGroup (SubstVecOperandAll body args))\n ))\n)\n\n (rule\n ((= num (Node (PureOp (Const (IntT) (const) (Num n1)))))\n (= lhs (badd (IntT) other num)))\n ((union lhs (badd (IntT) num other))))\n\n (rule\n ((= num (Node (PureOp (Const (IntT) (const) (Num n1)))))\n (= lhs (bmul (IntT) other num)))\n ((union lhs (bmul (IntT) num other))))\n\n (rule\n ((= lhs (badd (IntT)\n (Node (PureOp (badd (IntT) a b)))\n c)))\n ((union lhs\n (badd (IntT)\n a\n (Node (PureOp (badd (IntT) b c)))))))\n \n\n (rule\n ((= lhs (badd (IntT)\n a\n (Node (PureOp (badd (IntT) b c)))))\n (= b (Node (PureOp (Const (IntT) (const) (Num n1))))) \n )\n ((union lhs\n (badd (IntT)\n b\n (Node (PureOp (badd (IntT) a c)))))) \n )\n \n\n (rule\n ((= lhs (badd (IntT)\n a\n (Node (PureOp (badd (IntT) b c)))))\n (= a (Node (PureOp (Const (IntT) (const) (Num n1)))))\n (= b (Node (PureOp (Const (IntT) (const) (Num n2))))))\n\n ((union lhs\n (badd (IntT)\n (Node (PureOp (Const (IntT) (const) (Num (+ n1 n2)))))\n c)))) \n\n\n(let v0 \"main\")\n(let v1 (IntT))\n(let v2 (Bril v1))\n(let v3 (PrintState))\n(let v4 (vec-of v2 v2 v3))\n(let v5 (vec-of v3))\n(let v6 1)\n(let v7 2)\n(let v8 (BoolT))\n(let v9 (Arg v6))\n(let v10 4)\n(let v11 (Arg v10))\n(let v12 (blt v8 v9 v11))\n(let v13 (PureOp v12))\n(let v14 (Node v13))\n(let v15 0)\n(let v16 (Arg v15))\n(let v17 (Arg v7))\n(let v18 3)\n(let v19 (Arg v18))\n(let v20 (vec-of v16 v9 v17 v19 v11))\n(let v21 (VO v20))\n(let v22 (const))\n(let v23 (Num v15))\n(let v24 (Const v1 v22 v23))\n(let v25 (PureOp v24))\n(let v26 (Node v25))\n(let v27 (vec-of v16 v9 v26 v17 v19 v11))\n(let v28 (VO v27))\n(let v29 (blt v8 v19 v11))\n(let v30 (PureOp v29))\n(let v31 (Node v30))\n(let v32 5)\n(let v33 (Arg v32))\n(let v34 (vec-of v16 v9 v17 v19 v11 v33))\n(let v35 (VO v34))\n(let v36 (vec-of v16 v9 v17 v26 v19 v11 v33))\n(let v37 (VO v36))\n(let v38 (bmul v1 v9 v11))\n(let v39 (PureOp v38))\n(let v40 (Node v39))\n(let v41 (badd v1 v40 v19))\n(let v42 (PureOp v41))\n(let v43 (Node v42))\n(let v44 (PRINT v43 v16))\n(let v45 (PureOp v44))\n(let v46 (Node v45))\n(let v47 (Num v6))\n(let v48 (Const v1 v22 v47))\n(let v49 (PureOp v48))\n(let v50 (Node v49))\n(let v51 (badd v1 v19 v17))\n(let v52 (PureOp v51))\n(let v53 (Node v52))\n(let v54 (vec-of v46 v9 v17 v50 v53 v11 v33))\n(let v55 (VO v54))\n(let v56 (vec-of v37 v55))\n(let v57 (VVO v56))\n(let v58 (Gamma v31 v35 v57))\n(let v59 (Project v18 v58))\n(let v60 (vec-of v16 v9 v17 v26 v19 v11))\n(let v61 (VO v60))\n(let v62 (Project v15 v58))\n(let v63 (Project v6 v58))\n(let v64 (Project v7 v58))\n(let v65 (Project v10 v58))\n(let v66 (Project v32 v58))\n(let v67 6)\n(let v68 (Project v67 v58))\n(let v69 (vec-of v62 v63 v64 v65 v66 v68))\n(let v70 (VO v69))\n(let v71 (Theta v59 v61 v70))\n(let v72 (Project v15 v71))\n(let v73 (Project v6 v71))\n(let v74 (Project v7 v71))\n(let v75 (badd v1 v73 v74))\n(let v76 (PureOp v75))\n(let v77 (Node v76))\n(let v78 (Project v10 v71))\n(let v79 (Project v32 v71))\n(let v80 (vec-of v72 v77 v50 v74 v78 v79))\n(let v81 (VO v80))\n(let v82 (vec-of v28 v81))\n(let v83 (VVO v82))\n(let v84 (Gamma v14 v21 v83))\n(let v85 (Project v7 v84))\n(let v86 (vec-of v17 v26 v50 v9 v16))\n(let v87 (VO v86))\n(let v88 (Project v15 v84))\n(let v89 (Project v6 v84))\n(let v90 (Project v18 v84))\n(let v91 (Project v10 v84))\n(let v92 (Project v32 v84))\n(let v93 (vec-of v88 v89 v90 v91 v92))\n(let v94 (VO v93))\n(let v95 (Theta v85 v87 v94))\n(let v96 (Project v6 v95))\n(let v97 (Project v15 v95))\n(let v98 (PRINT v96 v97))\n(let v99 (PureOp v98))\n(let v100 (Node v99))\n(let v101 (vec-of v100))\n(let v102 (VO v101))\n(let v103 (Func v0 v4 v5 v102))\n\n(run-schedule\n ; only repeating twice to reduce benchmark CI performance\n ; increasing to 3 times will change benchmark time from 4 minutes to 40+ minutes\n (repeat 2 (saturate fast-analyses)\n (run)\n (saturate subst)))\n", + "eqsat-basic-multiset": ";; Example showing how to use multisets to hold associative & commutative operations\n\n(datatype*\n (Math\n (Num i64)\n (Var String)\n (Add Math Math)\n (Mul Math Math)\n (Product MathMultiSet)\n (Sum MathMultiSet))\n (sort MathToMath (UnstableFn (Math) Math))\n (sort MathMultiSet (MultiSet Math)))\n\n;; expr1 = 2 * (x + 3)\n(let expr1 (Mul (Num 2) (Add (Var \"x\") (Num 3))))\n;; expr2 = 6 + 2 * x\n(let expr2 (Add (Num 6) (Mul (Num 2) (Var \"x\"))))\n\n(rewrite (Add a b) (Sum (multiset-of a b)))\n(rewrite (Mul a b) (Product (multiset-of a b)))\n\n;; 0 or 1 elements sums/products also can be extracted back to numbers\n(rule\n (\n (= sum (Sum sum-inner))\n (= 0 (multiset-length sum-inner))\n )\n ((union sum (Num 0)))\n)\n(rule\n (\n (= sum (Sum sum-inner))\n (= 1 (multiset-length sum-inner))\n )\n ((union sum (multiset-pick sum-inner)))\n)\n\n(rule\n (\n (= product (Product product-inner))\n (= 0 (multiset-length product-inner))\n )\n ((union product (Num 1)))\n)\n(rule\n (\n (= product (Product product-inner))\n (= 1 (multiset-length product-inner))\n )\n ((union product (multiset-pick product-inner)))\n)\n\n; (rewrite (Mul a (Add b c))\n; (Add (Mul a b) (Mul a c)))\n\n; -> we would like to write it like this, but cannot (yet) bc we can't match on the inner structure of the multisets\n; and we don't support anonymous functions\n\n; (rewrite (Product (multiset-insert a (Sum bc)))\n; (Sum (multiset-map (lambda (x) (Product (multiset-insert a x))) bc)))\n\n\n;; so instead we can define a function and partially apply it to get the same function as the lambda\n(function tmp-fn (MathMultiSet Math) Math)\n(rewrite (tmp-fn xs x) (Product (multiset-insert xs x)))\n\n(rule\n (\n ;; and we can do a cross product search of all possible pairs of products/sums to find one we want\n (= sum (Sum bc))\n (= product (Product product-inner))\n (multiset-contains product-inner sum)\n (> (multiset-length product-inner) 1)\n (= a (multiset-remove product-inner sum))\n )\n (\n (union product (Sum\n (unstable-multiset-map\n (unstable-fn \"tmp-fn\" a)\n bc)\n ))\n )\n)\n\n; (rewrite (Add (Num a) (Num b))\n; (Num (+ a b)))\n\n(rule\n (\n (= sum (Sum sum-inner))\n (= num-a (Num a))\n (multiset-contains sum-inner num-a)\n (= without-a (multiset-remove sum-inner num-a))\n (= num-b (Num b))\n (multiset-contains without-a num-b)\n )\n (\n (union sum\n (Sum (multiset-insert (multiset-remove without-a num-b) (Num (+ a b))))\n )\n )\n)\n\n; (rewrite (Mul (Num a) (Num b))\n; (Num (* a b)))\n\n(rule\n (\n (= product (Product product-inner))\n (= num-a (Num a))\n (multiset-contains product-inner num-a)\n (= without-a (multiset-remove product-inner num-a))\n (= num-b (Num b))\n (multiset-contains without-a num-b)\n )\n (\n (union product\n (Product (multiset-insert (multiset-remove without-a num-b) (Num (* a b))))\n )\n )\n)\n\n(run 100)\n(check (= expr1 expr2))\n", + "eqsat-basic": "(datatype Math\n (Num i64)\n (Var String)\n (Add Math Math)\n (Mul Math Math))\n\n;; expr1 = 2 * (x + 3)\n(let expr1 (Mul (Num 2) (Add (Var \"x\") (Num 3))))\n;; expr2 = 6 + 2 * x\n(let expr2 (Add (Num 6) (Mul (Num 2) (Var \"x\"))))\n\n\n;; (rule ((= __root (Add a b)))\n;; ((union __root (Add b a)))\n(rewrite (Add a b)\n (Add b a))\n(rewrite (Mul a (Add b c))\n (Add (Mul a b) (Mul a c)))\n(rewrite (Add (Num a) (Num b))\n (Num (+ a b)))\n(rewrite (Mul (Num a) (Num b))\n (Num (* a b)))\n\n(run 10)\n(check (= expr1 expr2))\n", + "eqsolve": "(datatype Expr\n (Add Expr Expr)\n (Neg Expr)\n (Num i64)\n (Mul Expr Expr)\n (Var String)\n)\n\n(rewrite (Add x y) (Add y x))\n(rewrite (Add (Add x y) z) (Add x (Add y z)))\n(rewrite (Add (Num x) (Num y)) (Num (+ x y)))\n(rule ((= (Add x y) z))\n ((union (Add z (Neg y)) x)))\n(rewrite (Neg (Neg x)) x)\n(rewrite (Neg (Num n)) (Num (- 0 n)))\n\n(rule ((= x (Var v))) ((union (Mul (Num 1) x) x)))\n(rule ((= x (Add x1 x2))) ((union (Mul (Num 1) x) x)))\n(rewrite (Add (Mul y x) (Mul z x)) (Mul (Add y z) x))\n(rewrite (Mul x y) (Mul y x))\n(rule ((= (Mul (Num x) y) (Num z))\n (= (% z x) 0))\n ((union y (Num (/ z x)))))\n\n; system 1: x + 2 = 7\n(union (Add (Var \"x\") (Num 2)) (Num 7))\n; system 2: z + y = 6, 2z = y\n(union (Add (Var \"z\") (Var \"y\")) (Num 6))\n(union (Add (Var \"z\") (Var \"z\")) (Var \"y\"))\n\n(run 5)\n(query-extract (Var \"x\"))\n(query-extract (Var \"y\"))\n(query-extract (Var \"z\"))\n(check (= (Var \"z\") (Add (Num 6) (Neg (Var \"y\")))))\n(check (= (Var \"y\") (Add (Add (Num 6) (Neg (Var \"y\"))) (Add (Num 6) (Neg (Var \"y\"))))))\n(check (= (Var \"y\") (Add (Add (Num 12) (Neg (Var \"y\"))) (Neg (Var \"y\")))))\n(check (= (Add (Var \"y\") (Var \"y\")) \n (Add (Num 12) (Neg (Var \"y\")))))\n(check (= (Add (Add (Var \"y\") (Var \"y\")) (Var \"y\"))\n (Num 12)))\n(check (= (Add (Mul (Num 2) (Var \"y\")) (Var \"y\"))\n (Num 12)))\n(check (= (Mul (Num 3) (Var \"y\"))\n (Num 12)))\n", + "f64": "(check (= (neg 1.5) -1.5))\n(check (= (+ 1.5 9.2) 10.7))\n(check (= (/ 12.5 2.0) 6.25))\n(check (< 1.5 9.2))\n(check (>= 9.2 1.5))\n(check (= (^ 9.0 2.5) 243.0))\n(fail (check (= (^ 4.0 2.5) 31.99)))\n(fail (check (< 9.2 1.5)))\n(fail (check (= (+ 1.5 9.2) 10.6)))\n(check (= (to-f64 1) 1.0))\n(check (= (to-i64 1.0) 1))\n(check (= (to-string 1.2) \"1.2\"))\n(check (= (to-string 1.0) \"1.0\"))\n", + "unbound": "(datatype Math\n (Add Math Math)\n (Sub Math Math)\n)\n\n(rule ((= e (Add x y))) ((Add x i)))\n", + "unstable-fn-wrong-args-type": ";; test that you can't resolve a function with the wrong type of args\n\n(datatype Math\n (Zero)\n (Inc Math))\n\n(sort Fn (UnstableFn (i64) Math))\n(unstable-fn \"Inc\")\n", + "unstable-fn-wrong-args": ";; test that applying a function with the wrong number of args will violate the type checker\n\n\n(datatype Math\n (Inc Math))\n\n(sort Fn (UnstableFn (Math) Math))\n(unstable-app (unstable-fn \"Inc\") 10)\n", + "unstable-fn-wrong-return-type": ";; test that you can't resolve a function with the wrong return type\n\n(datatype Math\n (Zero)\n (Inc Math))\n\n(sort Fn (UnstableFn (Math) i64))\n(unstable-fn \"Inc\")\n", + "unstable-fn-wrong-return": ";; test that the value of a applied function is well typed\n\n\n(datatype Math\n (Zero)\n (Inc Math))\n\n(sort Fn (UnstableFn (Math) Math))\n(let x (unstable-app (unstable-fn \"Inc\") (Zero)))\n\n(+ x 10)\n", + "fail_wrong_assertion": ";; This test ensure check test fails for wrong assertion\n(function f (i64) i64 :merge (min old new))\n\n(set (f 1) 4)\n(set (f 1) 5)\n\n(check (= (f 1) 4))\n(fail (check (= (f 1) 2)))\n\n(delete (f 1))\n(fail (check (= (f 1) 4)))\n\n(function g (i64 i64) i64 :merge (min old new))\n\n(set (g 1 2) 3)\n(set (g 2 3) 3)\n\n(check (= (g 1 2) (g 2 3)))\n(fail (check (!= (g 1 2) (g 2 3))))\n(fail (check (= (g 0 2) (g 2 3))))\n(check (= x (g 1 2)))\n(fail (check (= x (g 1 3))))\n(check (= x (g 1 2)) (= y (g 2 3)) (= x y))\n(fail (check (= x (g 0 0)) (= y (g 1 1)) (= x y)))", + "fibonacci-demand": "(datatype Expr \n (Num i64 :cost 1)\n (Add Expr Expr :cost 5))\n\n(function Fib (i64) Expr :cost 10)\n\n(rewrite (Add (Num a) (Num b)) (Num (+ a b)))\n(rewrite (Fib x) (Add (Fib (- x 1)) (Fib (- x 2)))\n :when ((> x 1)))\n(rewrite (Fib x) (Num x)\n :when ((<= x 1)))\n\n(let f7 (Fib 7))\n(run 1000)\n(print-function Fib 10)\n(extract f7)\n(check (= f7 (Num 13)))\n \n ", + "fibonacci": "(function fib (i64) i64)\n(set (fib 0) 0)\n(set (fib 1) 1)\n\n(rule ((= f0 (fib x))\n (= f1 (fib (+ x 1))))\n ((set (fib (+ x 2)) (+ f0 f1))))\n\n(run 7)\n\n(check (= (fib 7) 13))", + "fusion": "(datatype Var)\n(datatype Term\n (App Term Term)\n (Lam Var Term)\n (TVar Var)\n (Let Var Term Term)\n (Add Term Term)\n (Num i64)\n (CaseSplit Term Term Term)\n (Cons Term Term))\n(function NilConst () Term)\n(let Nil (NilConst))\n\n(function V (String) Var) \n(function From (Term) Var)\n\n;; ==== FV ====\n(sort StringSet (Set Var))\n(function freer (Term) StringSet :merge (set-intersect old new))\n(rule ((= e (App e1 e2))\n (= (freer e1) fv1)\n (= (freer e2) fv2))\n ((set (freer e) (set-union fv1 fv2))))\n(rule ((= e (Lam var body))\n (= (freer body) fv))\n ((set (freer e) (set-remove fv var))))\n(rule ((= e (TVar v)))\n ((set (freer e) (set-insert (set-empty) v))))\n(rule ((= e (Let var e1 e2))\n (= (freer e1) fv1)\n (= (freer e2) fv2))\n ((set (freer e) (set-union fv1 (set-remove fv2 var)))))\n(rule ((= e (Add e1 e2))\n (= (freer e1) fv1)\n (= (freer e2) fv2))\n ((set (freer e) (set-union fv1 fv2))))\n(rule ((= e (Num v)))\n ((set (freer e) (set-empty))))\n(rule ((= e (CaseSplit e1 e2 e3))\n (= (freer e1) fv1)\n (= (freer e2) fv2)\n (= (freer e3) fv3))\n ((set (freer e) (set-union (set-union fv1 fv2) fv3))))\n(rule ((= e (Cons e1 e2))\n (= (freer e1) fv1)\n (= (freer e2) fv2))\n ((set (freer e) (set-union fv1 fv2))))\n(rule ((= e Nil))\n ((set (freer e) (set-empty))))\n\n;; ==== eval ====\n; beta\n(rewrite (App (Lam v body) e) (Let v e body))\n; case-split-nil\n(rewrite (CaseSplit Nil e1 e2) e1)\n; case-split-cons\n(rewrite (CaseSplit (Cons x xs) e1 e2) (App (App e2 x) xs))\n\n; let-num\n(rewrite (Let v e (Num n)) (Num n))\n; let-nil\n(rewrite (Let v e Nil) Nil)\n; let-var-same\n(rewrite (Let v1 e (TVar v1)) e)\n; let-var-diff\n(rewrite (Let v1 e (TVar v2)) (TVar v2) :when ((!= v1 v2)))\n\n; let-lam-close\n(rewrite (Let v1 e expr) expr :when ((set-not-contains (freer expr) v1))) \n; let-app\n(rewrite (Let v e expr) (App (Let v e a) (Let v e b)) :when ((= expr (App a b)) (set-contains (freer expr) v)))\n; let-add\n(rewrite (Let v e expr) (Add (Let v e a) (Let v e b)) :when ((= expr (Add a b)) (set-contains (freer expr) v)))\n; let-cons\n(rewrite (Let v e expr) (Cons (Let v e x) (Let v e xs)) :when ((= expr (Cons x xs)) (set-contains (freer expr) v)))\n; let-case-split\n(rewrite (Let v e expr) \n (CaseSplit (Let v e e1) (Let v e e2) (Let v e e3))\n :when ((= expr (CaseSplit e1 e2 e3))\n (set-contains (freer expr) v)))\n; let-lam-same\n(rewrite (Let v1 e (Lam v1 body)) (Lam v1 body))\n; let-lam-diff\n(rewrite (Let v1 e (Lam v2 body)) (Lam v2 (Let v1 e body))\n :when ((set-contains (freer body) v1)\n (!= v1 v2)\n (= fvs (freer e))\n (set-not-contains fvs v2)))\n(rule ((= expr (Let v1 e (Lam v2 body)))\n (set-contains (freer body) v1)\n (!= v1 v2)\n (= fvs (freer e))\n (set-contains fvs v2))\n ((union expr (Lam (From expr) (Let v1 e (Let v2 (TVar (From expr)) body))))))\n\n(function pushdown (Term Term) Term :cost 10000)\n(rewrite (App f (App (Lam x e) e2))\n (App (Lam x (pushdown f e)) e2))\n\n(rewrite (pushdown f (CaseSplit e e1 (Lam x (Lam xs e2)))) \n (CaseSplit e (App f e1) (Lam x (Lam xs (App f e2)))))\n\n(relation is-tail (Term))\n(rule ((= demand (pushdown f e)) (= e (App e1 e2))) ((is-tail e)))\n(rule ((= demand (pushdown f e)) (= e (Lam x e))) ((is-tail e)))\n(rule ((= demand (pushdown f e)) (= e (TVar x))) ((is-tail e)))\n(rule ((= demand (pushdown f e)) (= e (Cons e1 e2))) ((is-tail e)))\n(rule ((= demand (pushdown f e)) (= e Nil)) ((is-tail e)))\n(rule ((= demand (pushdown f e)) (= e (Add e1 e2))) ((is-tail e)))\n(rule ((= demand (pushdown f e)) (= e (Num n1))) ((is-tail e)))\n(rewrite (pushdown f e) (App f e) :when ((is-tail e)))\n\n;; ==== definition ====\n\n(function sum () Term :cost 1000)\n(function mapf () Term :cost 1000)\n(function sum-o-mapf () Term)\n(rewrite (App (sum) (App (mapf) x)) (App (sum-o-mapf) x))\n(union (sum) (Lam (V \"xs\")\n (CaseSplit (TVar (V \"xs\")) \n (Num 0)\n (Lam (V \"x\") (Lam (V \"xs'\") \n (Add (TVar (V \"x\")) (App (sum) (TVar (V \"xs'\")))))))))\n\n(union (mapf) (Lam (V \"xs\")\n (CaseSplit (TVar (V \"xs\"))\n Nil\n (Lam (V \"x\") (Lam (V \"xs'\")\n (Cons (Add (TVar (V \"x\")) (Num 1))\n (App (mapf) (TVar (V \"xs'\")))))))))\n\n(set (freer (sum)) (set-empty))\n(set (freer (mapf)) (set-empty))\n\n(let expr (App (sum) (App (mapf) (TVar (V \"expr\")))))\n\n(run 100)\n\n(query-extract (freer expr))\n\n\n(let my-output\n (CaseSplit (TVar (V \"expr\")) (Num 0) \n (Lam (V \"x\") (Lam (V \"xs'\") \n (Add (Add (TVar (V \"x\")) (Num 1)) \n (App (sum-o-mapf) (TVar (V \"xs'\"))))))))\n\n(check (= (App (sum-o-mapf) (TVar (V \"expr\")))\n (CaseSplit (TVar (V \"expr\")) (Num 0) \n (Lam (V \"x\") (Lam (V \"xs'\") \n (Add (Add (TVar (V \"x\")) (Num 1)) \n (App (sum-o-mapf) (TVar (V \"xs'\")))))))))\n", + "herbie-tutorial": "(datatype Math\n (Num Rational)\n (Var String)\n (Add Math Math)\n (Div Math Math)\n (Mul Math Math))\n\n(let zero (Num (rational 0 1)))\n(let one (Num (rational 1 1)))\n(let two (Num (rational 2 1)))\n\n(rewrite (Add a b) (Add b a))\n(rewrite (Add a zero) a)\n(rewrite (Add (Num r1) (Num r2))\n (Num (+ r1 r2)))\n\n(let one-two (Add one two))\n\n(push)\n(run 1)\n;; yay, constant folding works\n(check (= one-two (Num (rational 3 1))))\n;; also, commutativity works\n(check (= (Add two one) one-two))\n(pop)\n\n(push)\n;; rule is like rewrite, but more general\n;; the following rule doesn't union (Num r) with the result:\n(rule ((Num r))\n ((union one (Div (Num r) (Num r)))))\n;; uh oh, division by zero!\n(run 1)\n\n(pop)\n\n;; we need to detect when things are non-zero\n(function lower-bound (Math) Rational :merge (max old new))\n(function upper-bound (Math) Rational :merge (min old new))\n\n(rule ((Num r))\n ((set (lower-bound (Num r)) r)\n (set (upper-bound (Num r)) r)))\n(rule ((= e (Add a b)) (= x (lower-bound a)) (= y (lower-bound b)))\n ((set (lower-bound e) (+ x y))))\n(rule ((= e (Add a b)) (= x (upper-bound a)) (= y (upper-bound b)))\n ((set (upper-bound e) (+ x y))))\n(rule ((= e (Mul a b)))\n ((set (lower-bound e)\n (min (* (lower-bound a) (lower-bound b))\n (min (* (lower-bound a) (upper-bound b))\n (min (* (upper-bound a) (lower-bound b))\n (* (upper-bound a) (upper-bound b))))))\n (set (upper-bound e)\n (max (* (lower-bound a) (lower-bound b))\n (max (* (lower-bound a) (upper-bound b))\n (max (* (upper-bound a) (lower-bound b))\n (* (upper-bound a) (upper-bound b))))))))\n\n(rule ((= e (Add a b))\n (> (lower-bound e) (rational 0 1)))\n ((union one (Div (Add a b) (Add a b)))))\n\n(let x (Var \"x\"))\n(let x1 (Add x one))\n\n(push)\n(set (lower-bound x) (rational 0 1))\n(set (upper-bound x) (rational 1 1))\n\n(run 3)\n\n(query-extract (lower-bound x1))\n(query-extract (upper-bound x1))\n(check (= one (Div x1 x1)))\n\n(pop)\n\n\n;; Set the variable x to a particular input value 200/201\n(set (lower-bound x) (rational 200 201))\n(set (upper-bound x) (rational 200 201))\n\n(run 3)\n\n(query-extract (lower-bound x1))\n(query-extract (upper-bound x1))\n\n(function true-value (Math) f64)\n\n(rule ((= (to-f64 (lower-bound e))\n (to-f64 (upper-bound e))))\n ((set (true-value e)\n (to-f64 (lower-bound e)))))\n\n(run 1)\n(query-extract (true-value x1))\n\n(function best-error (Math) f64 :merge new :default (to-f64 (rational 10000 1)))\n\n(rule ((Num n))\n ((set (best-error (Num n)) (to-f64 n))))\n(rule ((Add a b)) ((best-error (Add a b))))\n\n;; finally, the mega rule for finding more accurate programs\n(rule ((= expr (Add a b))\n (= (best-error a) va)\n (= (best-error b) vb)\n (= true-v (true-value (Add a b)))\n (= computed (+ va vb))\n (< (abs (- computed true-v))\n (best-error (Add a b))))\n ((set (best-error (Add a b)) computed)))\n\n\n\n(push)\n\n(let target\n (Add \n (Add (Num (rational 1 100)) (Num (rational 1 100)))\n (Num (rational -2 100))))\n\n(run 1)\n\n;; set a default\n(best-error target)\n;; error is bad, constant folding hasn't fired enough\n(query-extract (best-error target))\n\n(run 1)\n\n;; error is good, constant folding has fired enough\n(query-extract (best-error target))\n\n\n(pop)", + "herbie": ";; Implements part of the simplification layer of herbie in egglog\ud83e\udee1\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;;\n;; Datatypes\n\n(datatype Math\n ; Ground terms\n (Num Rational)\n (Var String)\n\n ; Custom ops\n (Const String)\n (Unary String Math)\n ; unneeded for now\n ; (Binary String Math Math)\n\n ; Constant-folding ops\n (Add Math Math)\n (Sub Math Math)\n (Mul Math Math)\n (Div Math Math)\n (Pow Math Math)\n (Neg Math)\n (Sqrt Math)\n (Cbrt Math) ; cube root\n (Fabs Math)\n (Ceil Math)\n (Floor Math)\n (Round Math)\n (Log Math))\n\n(let r-zero (rational 0 1))\n(let r-one (rational 1 1))\n(let r-two (rational 2 1))\n(let zero (Num r-zero))\n(let one (Num r-one))\n(let two (Num r-two))\n(let three (Num (rational 3 1)))\n(let neg-one (Neg one))\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;;\n;; Analyses\n;; --------\n;; This example has three analyses:\n;; an interval analysis consisting of a hi and lo component\n;; and a non-zero analysis.\n;; The non-zero analysis is built off the interval analysis (in order to prove\n;; that rewrites are sound, even if some parts of an expr can't be const-evaled)\n\n; TODO: unbounded intervals?\n(function hi (Math) Rational :merge (min old new))\n(function lo (Math) Rational :merge (max old new))\n(relation non-zero (Math))\n\n;; First, constant folding!\n;; We don't need an explicit constant folding analysis, we can just union\n;; with nums when we can\n\n; Cases\n(rewrite (Add (Num a) (Num b)) (Num (+ a b)))\n(rewrite (Sub (Num a) (Num b)) (Num (- a b)))\n(rewrite (Mul (Num a) (Num b)) (Num (* a b)))\n(rewrite (Div (Num a) denom) (Num (/ a b)) :when ((= denom (Num b)) (non-zero denom)))\n(rewrite (Pow (Num a) (Num b)) (Num res) :when ((= res (pow a b))))\n(rewrite (Neg (Num a)) (Num (neg a)))\n;; TODO unimplemented\n;; (rewrite (Sqrt (Num a)) (Num res) :when ((= res (sqrt a))))\n;; (rewrite (Cbrt (Num a)) (Num res) :when ((= res (cbrt a))))\n(rewrite (Fabs (Num a)) (Num (abs a)))\n(rewrite (Ceil (Num a)) (Num (ceil a)))\n(rewrite (Floor (Num a)) (Num (floor a)))\n(rewrite (Round (Num a)) (Num (round a)))\n(rewrite (Log (Num a)) (Num res) :when ((= res (log a))))\n\n;; To check if something is zero, we check that zero is not contained in the\n;; interval. There are two possible (overlapping!) cases:\n;; - There exists a lo interval, in which case it must be larger than 0\n;; - There exists a hi interval, in which case it must be smaller than 0\n;; This assumes that intervals are well-formed: lo <= hi at all times.\n(rule ((= l (lo e))\n (> l r-zero))\n ((non-zero e)))\n(rule ((= h (hi e))\n (< h r-zero))\n ((non-zero e)))\n\n(rule ((= e (Num ve)))\n ((set (lo e) ve)\n (set (hi e) ve)))\n\n;; The interval analyses are similar to the constant-folding analysis,\n;; except we have to take the lower/upper bound of the results we get\n(rule ((= e (Add a b))\n (= la (lo a))\n (= lb (lo b)))\n ((set (lo e) (+ la lb))))\n(rule ((= e (Add a b))\n (= ha (hi a))\n (= hb (hi b)))\n ((set (hi e) (+ ha hb))))\n \n(rule ((= e (Sub a b))\n (= la (lo a))\n (= ha (hi a))\n (= lb (lo b))\n (= hb (hi b)))\n ((set (lo e) \n (min (min (- la lb) (- la hb))\n (min (- ha lb) (- ha hb))))\n (set (hi e) \n (max (max (- la lb) (- la hb))\n (max (- ha lb) (- ha hb))))))\n\n(rule ((= e (Mul a b))\n (= la (lo a))\n (= ha (hi a))\n (= lb (lo b))\n (= hb (hi b)))\n ((set (lo e) \n (min (min (* la lb) (* la hb))\n (min (* ha lb) (* ha hb))))\n (set (hi e) \n (max (max (* la lb) (* la hb))\n (max (* ha lb) (* ha hb))))))\n\n(rule ((= e (Div a b))\n (= la (lo a))\n (= ha (hi a))\n (= lb (lo b))\n (= hb (hi b)))\n ((set (lo e) \n (min (min (/ la lb) (/ la hb))\n (min (/ ha lb) (/ ha hb))))\n (set (hi e) \n (max (max (/ la lb) (/ la hb))\n (max (/ ha lb) (/ ha hb))))))\n\n; TODO: Pow\n\n(rule ((= e (Neg a))\n (= la (lo a))\n (= ha (hi a)))\n ((set (lo e) (neg ha))\n (set (hi e) (neg la))))\n\n; TODO: Sqrt\n; TODO: Cbrt\n\n(rule ((= e (Fabs a))\n (= la (lo a))\n (= ha (hi a)))\n ((set (lo e) (min (abs la) (abs ha)))\n (set (hi e) (max (abs la) (abs ha)))))\n\n(rule ((= e (Ceil a))\n (= la (lo a)))\n ((set (lo e) (ceil la))))\n(rule ((= e (Ceil a))\n (= ha (hi a)))\n ((set (hi e) (ceil ha))))\n\n(rule ((= e (Floor a))\n (= la (lo a)))\n ((set (lo e) (floor la))))\n(rule ((= e (Floor a))\n (= ha (hi a)))\n ((set (hi e) (floor ha))))\n\n(rule ((= e (Round a))\n (= la (lo a)))\n ((set (lo e) (round la))))\n(rule ((= e (Round a))\n (= ha (hi a)))\n ((set (hi e) (round ha))))\n\n; TODO: Log\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;;\n;; Rewrites\n;; --------\n;; These rewrites were compiled from src/syntax/rules.rkt in the herbie repo,\n;; using all rewrites in the `simplify` rewrite group.\n\n;; Commutativity\n(rewrite (Add a b) (Add b a))\n(rewrite (Mul a b) (Mul b a))\n\n;; Associativity\n(rewrite (Add a (Add b c)) (Add (Add a b) c))\n(rewrite (Add (Add a b) c) (Add a (Add b c)))\n(rewrite (Add a (Sub b c)) (Sub (Add a b) c))\n(rewrite (Add (Sub a b) c) (Sub a (Sub b c)))\n(rewrite (Sub a (Add b c)) (Sub (Sub a b) c))\n(rewrite (Sub (Add a b) c) (Add a (Sub b c)))\n(rewrite (Sub (Sub a b) c) (Sub a (Add b c)))\n(rewrite (Sub a (Sub b c)) (Add (Sub a b) c))\n(rewrite (Mul a (Mul b c)) (Mul (Mul a b) c))\n(rewrite (Mul (Mul a b) c) (Mul a (Mul b c)))\n(rewrite (Mul a (Div b c)) (Div (Mul a b) c))\n(rewrite (Mul (Div a b) c) (Div (Mul a c) b))\n(rewrite (Div a (Mul b c)) (Div (Div a b) c))\n(rewrite (Div (Mul b c) a) (Div b (Div a c)) :when ((non-zero c)))\n(rewrite (Div a (Div b c)) (Mul (Div a b) c) :when ((non-zero c)))\n(rewrite (Div (Div b c) a) (Div b (Mul a c)) :when ((non-zero a)))\n\n;; Counting\n(rewrite (Add x x) (Mul two x))\n\n;; Distributivity\n(rewrite (Mul a (Add b c)) (Add (Mul a b) (Mul a c)))\n(rewrite (Mul a (Add b c)) (Add (Mul b a) (Mul c a)))\n(rewrite (Add (Mul a b) (Mul a c)) (Mul a (Add b c)))\n(rewrite (Sub (Mul a b) (Mul a c)) (Mul a (Sub b c)))\n(rewrite (Add (Mul b a) (Mul c a)) (Mul a (Add b c)))\n(rewrite (Sub (Mul b a) (Mul c a)) (Mul a (Sub b c)))\n(rewrite (Add (Mul b a) a) (Mul (Add b one) a))\n(rewrite (Add a (Mul c a)) (Mul (Add c one) a))\n\n(rewrite (Neg (Mul a b)) (Mul (Neg a) b))\n(rewrite (Neg (Mul a b)) (Mul a (Neg b)))\n(rewrite (Mul (Neg a) b) (Neg (Mul a b)))\n(rewrite (Mul a (Neg b)) (Neg (Mul a b)))\n(rewrite (Neg (Add a b)) (Add (Neg a) (Neg b)))\n(rewrite (Add (Neg a) (Neg b)) (Neg (Add a b)))\n(rewrite (Div (Neg a) b) (Neg (Div a b)))\n(rewrite (Neg (Div a b)) (Div (Neg a) b))\n\n(rewrite (Sub a (Mul (Neg b) c)) (Add a (Mul b c)))\n(rewrite (Sub a (Mul b c)) (Add a (Mul (Neg b) c)))\n\n;; Difference of squares\n(rewrite (Mul (Mul a b) (Mul a b)) (Mul (Mul a a) (Mul b b)))\n(rewrite (Mul (Mul a a) (Mul b b)) (Mul (Mul a b) (Mul a b)))\n(rewrite (Sub (Mul a a) (Mul b b)) (Mul (Add a b) (Sub a b)))\n(rewrite (Sub (Mul a a) one) (Mul (Add a one) (Sub a one)))\n(rewrite (Add (Mul a a) (Neg one)) (Mul (Add a one) (Sub a one)))\n(rewrite (Pow a b) (Mul (Pow a (Div b two)) (Pow a (Div b two))))\n(rewrite (Mul (Pow a b) (Pow a b)) (Pow a (Mul two b)))\n\n;; Identity\n;; This isn't subsumed by const folding since this can return results\n;; even if we can't evaluate a precise value for x\n(rewrite (Div one (Div one x))\n x\n :when ((non-zero x)))\n(rewrite (Mul x (Div one x))\n one\n :when ((non-zero x)))\n(rewrite (Mul (Div one x) x)\n one\n :when ((non-zero x)))\n\n(rewrite (Sub x x) zero)\n(rewrite (Div x x) one\n :when ((non-zero x)))\n(rewrite (Div zero x) zero\n :when ((non-zero x)))\n(rewrite (Mul zero x) zero)\n(rewrite (Mul x zero) zero)\n\n(rewrite (Add zero x) x)\n(rewrite (Add x zero) x)\n(rewrite (Sub zero x) (Neg x))\n(rewrite (Sub x zero) x)\n(rewrite (Neg (Neg x)) x)\n(rewrite (Mul one x) x)\n(rewrite (Mul x one) x)\n(rewrite (Div x one) x)\n(rewrite (Mul neg-one x) (Neg x))\n \n(rewrite (Sub a b) (Add a (Neg b)))\n(rewrite (Add a (Neg b)) (Sub a b))\n(rewrite (Neg x) (Sub zero x))\n(rewrite (Neg x) (Mul neg-one x))\n\n(rewrite (Div x y) (Mul x (Div one y)))\n(rewrite (Mul x (Div one y)) (Div x y))\n(rewrite (Div x y) (Div one (Div y x))\n :when ((non-zero x)\n (non-zero y)))\n\n; FIXME: this rule can't be expressed in its full generality;\n; we can't express the general rule x -> 1/x since\n; we can't quantify over Math yet\n; for now we just apply it to vars\n; it's also p slow lmao\n(rewrite (Var x) (Mul one (Var x)))\n\n;; Fractions\n(rewrite (Div (Sub a b) c) (Sub (Div a c) (Div b c)))\n(rewrite (Div (Mul a b) (Mul c d)) (Mul (Div a c) (Div b d)))\n\n;; Square root\n(rewrite (Mul (Sqrt x) (Sqrt x)) x)\n(rewrite (Sqrt (Mul x x)) (Fabs x))\n\n(rewrite (Mul (Neg x) (Neg x)) (Mul x x))\n(rewrite (Mul (Fabs x) (Fabs x)) (Mul x x))\n\n;; Absolute values\n(rewrite (Fabs (Fabs x)) (Fabs x))\n(rewrite (Fabs (Sub a b)) (Fabs (Sub b a)))\n(rewrite (Fabs (Neg x)) (Fabs x))\n(rewrite (Fabs (Mul x x)) (Mul x x))\n(rewrite (Fabs (Mul a b)) (Mul (Fabs a) (Fabs b)))\n(rewrite (Fabs (Div a b)) (Div (Fabs a) (Fabs b)))\n\n;; Cube root\n(rewrite (Pow (Cbrt x) three) x)\n(rewrite (Cbrt (Pow x three)) x)\n(rewrite (Mul (Mul (Cbrt x) (Cbrt x)) (Cbrt x)) x)\n(rewrite (Mul (Cbrt x) (Mul (Cbrt x) (Cbrt x))) x)\n(rewrite (Pow (Neg x) three) (Neg (Pow x three)))\n\n(rewrite (Pow (Mul x y) three)\n (Mul (Pow x three) (Pow y three)))\n(rewrite (Pow (Div x y) three)\n (Div (Pow x three) (Pow y three)))\n \n(rewrite (Pow x three) (Mul x (Mul x x)))\n; FIXME: this rewrite is slow and has the potential to blow up the egraph\n; this is bc this rule and the second-to-last difference of squares rule\n; have some cyclic behavior goin on\n; the last identity rule compounds this behavior\n(rewrite (Mul x (Mul x x)) (Pow x three))\n\n;; Exponentials\n(rewrite (Unary \"exp\" (Log x)) x)\n(rewrite (Log (Unary \"exp\" x)) x)\n\n(rewrite (Unary \"exp\" zero) one)\n(rewrite (Unary \"exp\" one) (Const \"E\"))\n;; (rewrite one (Unary \"exp\" zero))\n(rewrite (Const \"E\") (Unary \"exp\" one))\n\n(rewrite (Unary \"exp\" (Add a b)) (Mul (Unary \"exp\" a) (Unary \"exp\" b)))\n(rewrite (Unary \"exp\" (Sub a b)) (Div (Unary \"exp\" a) (Unary \"exp\" b)))\n(rewrite (Unary \"exp\" (Neg a)) (Div one (Unary \"exp\" a)))\n\n(rewrite (Mul (Unary \"exp\" a) (Unary \"exp\" b)) (Unary \"exp\" (Add a b)))\n(rewrite (Div one (Unary \"exp\" a)) (Unary \"exp\" (Neg a)))\n(rewrite (Div (Unary \"exp\" a) (Unary \"exp\" b)) (Unary \"exp\" (Sub a b)))\n(rewrite (Unary \"exp\" (Mul a b)) (Pow (Unary \"exp\" a) b))\n(rewrite (Unary \"exp\" (Div a two)) (Sqrt (Unary \"exp\" a)))\n(rewrite (Unary \"exp\" (Div a three)) (Cbrt (Unary \"exp\" a)))\n(rewrite (Unary \"exp\" (Mul a two)) (Mul (Unary \"exp\" a) (Unary \"exp\" a)))\n(rewrite (Unary \"exp\" (Mul a three)) (Pow (Unary \"exp\" a) three))\n\n;; Powers\n(rewrite (Pow a neg-one) (Div one a))\n(rewrite (Pow a one) a)\n\n; 0^0 is undefined\n(rewrite (Pow a zero) one :when ((non-zero a)))\n(rewrite (Pow one a) one)\n\n(rewrite (Unary \"Exp\" (Mul (Log a) b)) (Pow a b))\n(rewrite (Mul (Pow a b) a) (Pow a (Add b one)))\n(rewrite (Pow a (Num (rational 1 2))) (Sqrt a))\n(rewrite (Pow a two) (Mul a a))\n(rewrite (Pow a (Num (rational 1 3))) (Cbrt a))\n(rewrite (Pow a three) (Mul (Mul a a) a))\n\n; 0^0 is undefined\n(rewrite (Pow zero a) zero :when ((non-zero a)))\n\n;; Logarithms\n(rewrite (Log (Mul a b)) (Add (Log a) (Log b)))\n(rewrite (Log (Div a b)) (Sub (Log a) (Log b)))\n(rewrite (Log (Div one a)) (Neg (Log a)))\n(rewrite (Log (Pow a b)) (Mul b (Log a)))\n(rewrite (Log (Const \"E\")) one)\n\n;; Trigonometry\n(rewrite (Add (Mul (Unary \"cos\" a) (Unary \"cos\" a)) (Mul (Unary \"sin\" a) (Unary \"sin\" a)))\n one)\n(rewrite (Sub one (Mul (Unary \"cos\" a) (Unary \"cos\" a)))\n (Mul (Unary \"sin\" a) (Unary \"sin\" a)))\n(rewrite (Sub one (Mul (Unary \"sin\" a) (Unary \"sin\" a)))\n (Mul (Unary \"cos\" a) (Unary \"cos\" a)))\n(rewrite (Add (Mul (Unary \"cos\" a) (Unary \"cos\" a)) (Num (rational -1 1))) \n (Neg (Mul (Unary \"sin\" a) (Unary \"sin\" a))))\n(rewrite (Add (Mul (Unary \"sin\" a) (Unary \"sin\" a)) (Num (rational -1 1))) \n (Neg (Mul (Unary \"cos\" a) (Unary \"cos\" a))))\n(rewrite (Sub (Mul (Unary \"cos\" a) (Unary \"cos\" a)) one) \n (Neg (Mul (Unary \"sin\" a) (Unary \"sin\" a))))\n(rewrite (Sub (Mul (Unary \"sin\" a) (Unary \"sin\" a)) one) \n (Neg (Mul (Unary \"cos\" a) (Unary \"cos\" a))))\n(rewrite (Unary \"sin\" (Div (Const \"PI\") (Num (rational 6 1)))) \n (Num (rational 1 2)))\n(rewrite (Unary \"sin\" (Div (Const \"PI\") (Num (rational 4 1)))) \n (Div (Sqrt two) two))\n(rewrite (Unary \"sin\" (Div (Const \"PI\") three)) \n (Div (Sqrt three) two))\n(rewrite (Unary \"sin\" (Div (Const \"PI\") two)) \n one)\n(rewrite (Unary \"sin\" (Const \"PI\")) \n zero)\n(rewrite (Unary \"sin\" (Add x (Const \"PI\"))) \n (Neg (Unary \"sin\" x)))\n(rewrite (Unary \"sin\" (Add x (Div (Const \"PI\") two))) \n (Unary \"cos\" x))\n(rewrite (Unary \"cos\" (Div (Const \"PI\") (Num (rational 6 1)))) \n (Div (Sqrt three) two))\n(rewrite (Unary \"cos\" (Div (Const \"PI\") (Num (rational 4 1)))) \n (Div (Sqrt two) two))\n(rewrite (Unary \"cos\" (Div (Const \"PI\") three)) \n (Num (rational 1 2)))\n(rewrite (Unary \"cos\" (Div (Const \"PI\") two)) \n zero)\n(rewrite (Unary \"cos\" (Const \"PI\")) \n (Num (rational -1 1)))\n(rewrite (Unary \"cos\" (Add x (Const \"PI\"))) \n (Neg (Unary \"cos\" x)))\n(rewrite (Unary \"cos\" (Add x (Div (Const \"PI\") two))) \n (Neg (Unary \"sin\" x)))\n(rewrite (Unary \"tan\" (Div (Const \"PI\") (Num (rational 6 1)))) \n (Div one (Sqrt three)))\n(rewrite (Unary \"tan\" (Div (Const \"PI\") (Num (rational 4 1)))) \n one)\n(rewrite (Unary \"tan\" (Div (Const \"PI\") three)) \n (Sqrt three))\n(rewrite (Unary \"tan\" (Const \"PI\")) \n zero)\n(rewrite (Unary \"tan\" (Add x (Const \"PI\"))) \n (Unary \"tan\" x))\n(rewrite (Unary \"tan\" (Add x (Div (Const \"PI\") two))) \n (Div neg-one (Unary \"tan\" x)))\n(rewrite (Div (Unary \"sin\" a) (Add one (Unary \"cos\" a))) \n (Unary \"tan\" (Div a two)))\n(rewrite (Div (Neg (Unary \"sin\" a)) (Add one (Unary \"cos\" a)))\n (Unary \"tan\" (Div (Neg a) two)))\n(rewrite (Div (Sub one (Unary \"cos\" a)) (Unary \"sin\" a)) \n (Unary \"tan\" (Div a two)))\n(rewrite (Div (Sub one (Unary \"cos\" a)) (Neg (Unary \"sin\" a)))\n (Unary \"tan\" (Div (Neg a) two)))\n(rewrite (Div (Add (Unary \"sin\" a) (Unary \"sin\" b)) (Add (Unary \"cos\" a) (Unary \"cos\" b)))\n (Unary \"tan\" (Div (Add a b) two)))\n(rewrite (Div (Sub (Unary \"sin\" a) (Unary \"sin\" b)) (Add (Unary \"cos\" a) (Unary \"cos\" b)))\n (Unary \"tan\" (Div (Sub a b) two)))\n\n(rewrite (Unary \"sin\" zero) zero)\n(rewrite (Unary \"cos\" zero) one)\n(rewrite (Unary \"tan\" zero) zero)\n\n(rewrite (Unary \"sin\" (Neg x)) (Neg (Unary \"sin\" x)))\n(rewrite (Unary \"cos\" (Neg x)) (Unary \"cos\" x))\n(rewrite (Unary \"tan\" (Neg x)) (Neg (Unary \"cos\" x)))\n\n; Hyperbolics\n(rewrite (Unary \"sinh\" x) (Div (Sub (Unary \"exp\" x) (Unary \"exp\" (Neg x))) two))\n(rewrite (Unary \"cosh\" x) (Div (Add (Unary \"exp\" x) (Unary \"exp\" (Neg x))) two))\n(rewrite (Unary \"tanh\" x) (Div (Sub (Unary \"exp\" x) (Unary \"exp\" (Neg x))) (Add (Unary \"exp\" x) (Unary \"exp\" (Neg x)))))\n(rewrite (Unary \"tanh\" x) (Div (Sub (Unary \"exp\" (Mul two x)) one) (Add (Unary \"exp\" (Mul two x)) one)))\n(rewrite (Unary \"tanh\" x) (Div (Sub one (Unary \"exp\" (Mul (Num (rational -2 1)) x))) (Add one (Unary \"exp\" (Mul (Num (rational -2 1)) x)))))\n(rewrite (Sub (Mul (Unary \"cosh\" x) (Unary \"cosh\" x)) (Mul (Unary \"sinh\" x) (Unary \"sinh\" x))) one)\n(rewrite (Add (Unary \"cosh\" x) (Unary \"sinh\" x)) (Unary \"exp\" x))\n(rewrite (Sub (Unary \"cosh\" x) (Unary \"sinh\" x)) (Unary \"exp\" (Neg x)))\n\n;; Unimplemented: misc. rewrites (conditionals, specialized numerical fns)\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;;\n;; Testing\n;; -------\n;; In actuality, herbie would be responsible for plugging exprs in here.\n;; For our purposes, we take some test cases from herbie\n;; (src/core/simplify.rkt)\n\n(push)\n(let e (Add one zero))\n(run 1)\n(check (= e one))\n(pop)\n\n(push)\n(let five (Num (rational 5 1)))\n(let six (Num (rational 6 1)))\n(let e2 (Add one five))\n(run 1)\n(check (= e2 six))\n(pop)\n\n(let x (Var \"x\"))\n\n(push)\n(let e3 (Add x zero))\n(run 1)\n(check (= e3 x))\n(pop)\n\n(push)\n(let e4 (Sub x zero))\n(run 1)\n(check (= e4 x))\n(pop)\n\n(push)\n\n(let e5 (Mul x one))\n(run 1)\n(check (= e5 x))\n(pop)\n\n(push)\n\n(let e6 (Div x one))\n(run 1)\n(check (= e6 x))\n(pop)\n\n(push)\n\n(let e7 (Sub (Mul one x) (Mul (Add x one) one)))\n(run 3)\n(check (= e7 (Num (rational -1 1))))\n(pop)\n\n(push)\n\n(let e8 (Sub (Add x one) x))\n(run 4)\n(check (= e8 one))\n(pop)\n\n(push)\n\n(let e9 (Sub (Add x one) one))\n(run 4)\n(check (= e9 x))\n(pop)\n\n(push)\n\n(set (lo x) r-one)\n(let e10 (Div (Mul x three) x))\n(run 3)\n(check (= e10 three))\n(pop)\n\n(push)\n\n(let e11 (Sub (Mul (Sqrt (Add x one)) (Sqrt (Add x one))) (Mul (Sqrt x) (Sqrt x))))\n(run 5)\n(check (= one e11))\n(pop)\n\n(push)\n(let e12 (Add (Num (rational 1 5)) (Num (rational 3 10))))\n(run 1)\n(check (= e12 (Num (rational 1 2))))\n(pop)\n\n(push)\n(let e13 (Unary \"cos\" (Const \"PI\")))\n(run 1)\n(check (= e13 (Num (rational -1 1))))\n(pop)\n\n(push)\n(let sqrt5 (Sqrt (Num (rational 5 1))))\n(let e14\n (Div one (Sub (Div (Add one sqrt5) two) (Div (Sub one sqrt5) two))))\n(let tgt (Div one sqrt5))\n(run 6)\n(check (= e14 tgt))\n(pop)", + "i64": "(check (= (to-string 20) \"20\"))\n", + "include": "(include \"tests/path.egg\")\n(check (path 1 3))\n", + "integer_math": "(datatype Math\n (Diff Math Math)\n (Integral Math Math)\n \n (Add Math Math)\n (Sub Math Math)\n (Mul Math Math)\n (Div Math Math)\n (Pow Math Math)\n (RShift Math Math)\n (LShift Math Math)\n (Mod Math Math)\n (Not Math)\n \n (Const i64)\n (Var String))\n\n(relation MathU (Math))\n(rule ((= e (Diff x y))) ((MathU e)))\n(rule ((= e (Integral x y))) ((MathU e)))\n(rule ((= e (Add x y))) ((MathU e)))\n(rule ((= e (Sub x y))) ((MathU e)))\n(rule ((= e (Mul x y))) ((MathU e)))\n(rule ((= e (Div x y))) ((MathU e)))\n(rule ((= e (Pow x y))) ((MathU e)))\n(rule ((= e (Const x))) ((MathU e)))\n(rule ((= e (Var x))) ((MathU e)))\n(rule ((= e (RShift x y))) ((MathU e)))\n(rule ((= e (LShift x y))) ((MathU e)))\n(rule ((= e (Mod x y))) ((MathU e)))\n(rule ((= e (Not x))) ((MathU e)))\n\n(relation evals-to (Math i64))\n(rule ((evals-to x vx)) ((union x (Const vx))))\n(rule ((= e (Const c))) ((evals-to e c)))\n\n(relation is-not-zero (Math))\n(rule ((MathU a) (!= a (Const 0))) ((is-not-zero a)))\n\n;; Evaluation\n(rewrite (Add (Const a) (Const b))\n (Const (+ a b)))\n(rewrite (Sub (Const a) (Const b))\n (Const (- a b)))\n(rewrite (Mul (Const a) (Const b)) (Const (* a b)))\n(rewrite (Div (Const a) (Const b)) (Const (/ a b)) :when ((!= 0 b)))\n(rewrite (RShift (Const a) (Const b)) (Const (>> a b)))\n(rewrite (LShift (Const a) (Const b)) (Const (<< a b)))\n(rewrite (Not (Const a)) (Const (not-i64 a)))\n\n;; Properties\n(rewrite (Add a b) (Add b a))\n(rewrite (Mul a b) (Mul b a))\n(rewrite (Add a (Add b c)) (Add (Add a b) c))\n(rewrite (Mul a (Mul b c)) (Mul (Mul a b) c))\n\n(rewrite (Sub a b) (Add a (Mul (Const -1) b)))\n\n(rewrite (Add a (Const 0)) a)\n(rewrite (Mul a (Const 0)) (Const 0))\n(rewrite (Mul a (Const 1)) a)\n\n(rule ((MathU a) (!= a (Const 0))) ((union a (Add a (Const 0)))))\n(rule ((MathU a) (!= a (Const 1))) ((union a (Mul a (Const 1)))))\n\n(rewrite (Sub a a) (Const 0))\n(rewrite (Div a a) (Const 1) :when ((is-not-zero a)))\n\n(rewrite (Mul a (Add b c)) (Add (Mul a b) (Mul a c)))\n(rewrite (Add (Mul a b) (Mul a c)) (Mul a (Add b c)))\n\n; This rule doesn't work when pow is negative - consider 2^-1 * 2^1, which is 0, but 2^0 = 1\n(rewrite (Mul (Pow a b) (Pow a c)) (Pow a (Add b c)) :when ((is-not-zero b) (is-not-zero c)))\n\n(rewrite (Pow x (Const 0)) (Const 1) :when ((is-not-zero x)))\n(rewrite (Pow x (Const 1 )) x)\n(rewrite (Pow x (Const 2)) (Mul x x))\n\n(rewrite (Pow x (Const -1)) (Div (Const 1) x) :when ((is-not-zero x)))\n\n(rewrite (Mul x (Pow (Const 2) y)) (LShift x y))\n(rewrite (Div x (Pow (Const 2) y)) (RShift x y))\n\n(rewrite (Not (Not x)) x)\n\n\n;; Tests\n(let start-expr (Div (\n Mul (Var \"a\") (Pow (Const 2) (Const 3))\n ) (\n Add (Var \"c\") (\n Sub (Mul (Var \"b\") (Const 2)) (Mul (Var \"b\") (Const 2))\n )\n )))\n\n(let equiv-expr (Div (\n LShift (Var \"a\") (Const 3)\n ) (\n Mul (Var \"c\") (Not (Not (Const 1)))\n )\n ))\n\n(run 4)\n\n(check (= start-expr equiv-expr))\n\n", + "intersection": ";; computes \"e-graph intersection\"\n\n(datatype Expr\n (Var String)\n (f Expr))\n\n(function intersect (Expr Expr) Expr)\n\n(rule (\n (= x3 (intersect x1 x2))\n (= f1 (f x1))\n (= f2 (f x2))\n)(\n (union (intersect f1 f2) (f x3))\n))\n\n(let a1 (Var \"a1\")) (let a2 (Var \"a2\")) (let a3 (Var \"a3\"))\n(let b1 (Var \"b1\")) (let b2 (Var \"b2\")) (let b3 (Var \"b3\"))\n\n;; e-graph 1: f(a) = f(b), f(f(a))\n(let t1 (f (f a1)))\n(let fb1 (f b1))\n(union (f a1) fb1)\n\n;; e-graph 2: f(f(a)) = f(f(b))\n(let t2 (f (f a2)))\n(let t2p (f (f b2)))\n(union t2 t2p)\n\n(union (intersect a1 a2) a3)\n(union (intersect b1 b2) b3)\n\n(run 100)\n\n(let t3 (f (f a3)))\n(query-extract :variants 5 t3)\n\n;; f(f(a)) = f(f(b)) is preserved\n(check (= (f (f a3)) (f (f b3))))\n;; but not f(a) = f(b), it was only in e-graph 1\n(check (!= (f a3) (f b3)))", + "interval": "(datatype Math\n (Num Rational)\n (Var String)\n (Mul Math Math))\n\n(function hi (Math) Rational :merge (min old new))\n(function lo (Math) Rational :merge (max old new))\n\n(rule ((= mul (Mul a b)))\n ((set (lo mul) \n (min (min (* (lo a) (lo b)) (* (lo a) (hi b)))\n (min (* (hi a) (lo b)) (* (hi a) (hi b)))))))\n\n(let x (Var \"x\"))\n(let e (Mul x x))\n\n(set (lo x) (rational -10 1))\n(set (hi x) (rational 10 1))\n\n(run 1)\n\n(check (= (lo e) (rational -100 1)))\n\n(rule ((= mul (Mul a a)))\n ((set (lo mul) (* (lo a) (lo a)))))\n\n(run 1)\n(check (= (lo e) (rational 100 1)))\n\n;; testing extraction of rationals\n(query-extract (lo e))\n", + "knapsack": "(datatype expr \n (Num i64)\n (Add expr expr)\n (Max expr expr))\n(rewrite (Add (Num a) (Num b)) (Num (+ a b)))\n(rewrite (Max (Num a) (Num b)) (Num (max a b)))\n\n; List of (weight, value) pairs\n(datatype objects\n (Cons i64 i64 objects))\n(function NilConst () objects)\n(let Nil (NilConst))\n\n; Given a capacity and a list of objects, finds the maximum value of a\n; collection of objects whose total weight does not exceed the capacity.\n(function Knap (i64 objects) expr)\n\n(rule ((= f (Knap capacity (Cons weight val rest))) (<= weight capacity))\n ((union (Knap capacity (Cons weight val rest))\n (Max\n (Add (Num val) (Knap (- capacity weight) rest))\n (Knap capacity rest)))))\n\n(rule ((= f (Knap capacity (Cons weight val rest))) (> weight capacity))\n ((union (Knap capacity (Cons weight val rest))\n (Knap capacity rest))))\n\n(rule ((= f (Knap capacity Nil)))\n ((union (Knap capacity Nil) (Num 0))))\n\n(let test1 (Knap 13 (Cons 5 5 (Cons 3 3 (Cons 12 12 (Cons 5 5 Nil))))))\n\n(let test2 (Knap 5 (Cons 6 6 Nil)))\n\n(let test3 (Knap 5 (Cons 1 1 (Cons 1 1 (Cons 1 1 Nil)))))\n\n(let test4 (Knap 15 (Cons 12 40 (Cons 2 20 (Cons 1 20 (Cons 1 10 (Cons 4 100 Nil)))))))\n\n; turn a (Num n) into n\n(function Unwrap (expr) i64)\n(rule ((= x (Num n))) ((set (Unwrap (Num n)) n)))\n\n(run 100)\n\n(check (= test1 (Num 13)))\n\n", + "lambda": ";; NOTE: This file contains several unsafe operations\n(datatype Value (Num i64))\n(function TrueConst () Value)\n(let True (TrueConst))\n(function FalseConst () Value)\n(let False (FalseConst))\n(datatype VarType)\n(datatype Term\n (Val Value)\n (Var VarType)\n (Add Term Term)\n (Eq Term Term)\n (App Term Term)\n (Lam VarType Term)\n (Let VarType Term Term)\n (Fix VarType Term)\n (If Term Term Term))\n(function V (String) VarType) \n(function From (Term) VarType)\n\n; All free variables are free,\n; but some free variables are more free than others\n; Freer variables will only contain variables\n; that will affect the evaluation\n; of the corresponding term\n; e.g., x is free in x - x, but not freer in x - x\n(sort StringSet (Set VarType))\n(function freer (Term) StringSet :merge (set-intersect old new))\n(rule ((= e (Val v)))\n ((set (freer e) (set-empty))))\n(rule ((= e (Var v)))\n ((set (freer e) (set-insert (set-empty) v))))\n(rule ((= e (Add e1 e2))\n (= (freer e1) fv1)\n (= (freer e2) fv2))\n ((set (freer e) (set-union fv1 fv2))))\n(rule ((= e (Eq e1 e2))\n (= (freer e1) fv1)\n (= (freer e2) fv2))\n ((set (freer e) (set-union fv1 fv2))))\n(rule ((= e (App e1 e2))\n (= (freer e1) fv1)\n (= (freer e2) fv2))\n ((set (freer e) (set-union fv1 fv2))))\n(rule ((= e (Lam var body))\n (= (freer body) fv))\n ((set (freer e) (set-remove fv var))))\n(rule ((= e (Let var e1 e2))\n (= (freer e1) fv1)\n (= (freer e2) fv2))\n ((set (freer e) (set-union fv1 (set-remove fv2 var)))))\n(rule ((= e (Fix var body))\n (= (freer body) fv))\n ((set (freer e) (set-remove fv var))))\n(rule ((= e (If c e1 e2))\n (= (freer c) fv1)\n (= (freer e1) fv2)\n (= (freer e2) fv3))\n ((set (freer e) (set-union fv1 (set-union fv2 fv3)))))\n\n;; START evals-to\n(function evals-to (Term) Value)\n\n(rule ((= e (Val val)))\n ((union (evals-to e) val)))\n(rule ((= e (Add a b))\n (= (Num va) (evals-to a))\n (= (Num vb) (evals-to b)))\n ((union (evals-to e) (Num (+ va vb)))))\n(rule ((= e (Eq a b))\n (= (evals-to b) (evals-to a)))\n ((union (evals-to e) True)))\n(rule ((= e (Eq a b))\n (= va (evals-to a))\n (= vb (evals-to b))\n (!= va vb)) ; TODO: if true and false are non-mergeable datatype, \n ; we should be able to do != over it\n ((union (evals-to e) False)))\n(rule ((= v (evals-to e)))\n ((union e (Val v))))\n;; END evals-to\n\n; if-true\n(rewrite (If (Val True) then else) then)\n; if-false\n(rewrite (If (Val False) then else) else)\n; if-elim\n(rule ((= term (If (Eq (Var x) e) then else)))\n ((Let x e then)\n (Let x e else)))\n(rewrite (If (Eq (Var x) e) then else) else\n :when ((= (Let x e then) (Let x e else))))\n\n; add-comm\n(rewrite (Add a b) (Add b a))\n; add-assoc\n(rewrite (Add (Add a b) c) (Add a (Add b c)))\n; eq-comm\n(rewrite (Eq a b) (Eq b a))\n\n; fix\n(rewrite (Fix v e) (Let v (Fix v e) e))\n; beta\n(rewrite (App (Lam v body) e) (Let v e body))\n; let-app\n(rewrite (Let v e (App a b)) (App (Let v e a) (Let v e b)))\n; let-add\n(rewrite (Let v e (Add a b)) (Add (Let v e a) (Let v e b)))\n; let-eq\n(rewrite (Let v e (Eq a b)) (Eq (Let v e a) (Let v e b)))\n; let-const\n(rewrite (Let v e c) c :when ((= const (evals-to c))))\n; let-if\n(rewrite (Let v e (If cond then else)) \n (If (Let v e cond) (Let v e then) (Let v e else)))\n; let-var-same\n(rewrite (Let v1 e (Var v1)) e)\n; let-var-diff\n(rewrite (Let v1 e (Var v2)) (Var v2) :when ((!= v1 v2)))\n; let-lam-same\n(rewrite (Let v1 e (Lam v1 body)) (Lam v1 body))\n; let-lam-diff\n(rewrite (Let v1 e (Lam v2 body)) (Lam v2 (Let v1 e body))\n :when ((!= v1 v2)\n (= fvs (freer e))\n (set-not-contains fvs v2)))\n(rule ((= expr (Let v1 e (Lam v2 body)))\n (!= v1 v2)\n (= fvs (freer e))\n (set-contains fvs v2))\n ((union expr (Lam (From expr) (Let v1 e (Let v2 (Var (From expr)) body))))))\n\n;; lambda_under\n(push)\n(let e \n (Lam (V \"x\") \n (Add (Val (Num 4))\n (App (Lam (V \"y\") (Var (V \"y\"))) (Val (Num 4))))))\n(run 10)\n(check (= e (Lam (V \"x\") (Val (Num 8)))))\n(pop)\n\n;; lambda_if_elim\n(push)\n(let e2 (If (Eq (Var (V \"a\")) (Var (V \"b\")))\n (Add (Var (V \"a\")) (Var (V \"a\")))\n (Add (Var (V \"a\")) (Var (V \"b\")))))\n(run 10)\n(check (= e2 (Add (Var (V \"a\")) (Var (V \"b\")))))\n(pop)\n\n;; lambda_let_simple\n(push)\n(let e3 (Let (V \"x\") (Val (Num 0))\n (Let (V \"y\") (Val (Num 1))\n (Add (Var (V \"x\")) (Var (V \"y\"))))))\n(run 10)\n(check (= e3 (Val (Num 1))))\n(pop)\n\n;; lambda_capture\n(push)\n(let e4 (Let (V \"x\") (Val (Num 1)) \n (Lam (V \"x\") (Var (V \"x\")))))\n(run 10)\n(fail (check (= e4 (Lam (V \"x\") (Val (Num 1))))))\n(pop)\n\n;; lambda_capture_free\n(push)\n(let e5 (Let (V \"y\") (Add (Var (V \"x\")) (Var (V \"x\"))) \n (Lam (V \"x\") (Var (V \"y\")))))\n(run 10)\n(check (set-contains (freer (Lam (V \"x\") (Var (V \"y\")))) (V \"y\")))\n(fail (check (= e5 (Lam (V \"x\") (Add (Var (V \"x\")) (Var (V \"x\")))))))\n(pop)\n\n;; lambda_closure_not_seven\n(push)\n(let e6\n (Let (V \"five\") (Val (Num 5))\n (Let (V \"add-five\") (Lam (V \"x\") (Add (Var (V \"x\")) (Var (V \"five\"))))\n (Let (V \"five\") (Val (Num 6))\n (App (Var (V \"add-five\")) (Val (Num 1)))))))\n(run 10)\n(fail (check (= e6 (Val (Num 7)))))\n(check (= e6 (Val (Num 6))))\n(pop)\n\n\n;; lambda_compose\n(push)\n(let e7\n (Let (V \"compose\") (Lam (V \"f\") \n (Lam (V \"g\") \n (Lam (V \"x\") (App (Var (V \"f\"))\n (App (Var (V \"g\")) \n (Var (V \"x\")))))))\n (Let (V \"add1\") (Lam (V \"y\") (Add (Var (V \"y\")) (Val (Num 1))))\n (App (App (Var (V \"compose\")) (Var (V \"add1\"))) (Var (V \"add1\"))))))\n(run 20)\n(check (= e7 (Lam x (Add (Var x) (Val (Num 2))))))\n(pop)\n\n;; lambda_if_simple\n(push)\n(let e10 (If (Eq (Val (Num 1)) (Val (Num 1))) (Val (Num 7)) (Val (Num 9))))\n(run 4)\n(check (= e10 (Val (Num 7))))\n(pop)\n\n;; lambda_compose_many\n(push)\n(let e11\n (Let (V \"compose\") (Lam (V \"f\") (Lam (V \"g\") (Lam (V \"x\") (App (Var (V \"f\"))\n (App (Var (V \"g\")) (Var (V \"x\")))))))\n (Let (V \"add1\") (Lam (V \"y\") (Add (Var (V \"y\")) (Val (Num 1))))\n (App (App (Var (V \"compose\")) (Var (V \"add1\")))\n (App (App (Var (V \"compose\")) (Var (V \"add1\")))\n (App (App (Var (V \"compose\")) (Var (V \"add1\")))\n (App (App (Var (V \"compose\")) (Var (V \"add1\")))\n (App (App (Var (V \"compose\")) (Var (V \"add1\")))\n (App (App (Var (V \"compose\")) (Var (V \"add1\")))\n (Var (V \"add1\")))))))))))\n\n(run 30)\n(check (= e11 (Lam x (Add (Var x) (Val (Num 7))))))\n(pop)\n\n;; lambda_if\n(push)\n(let e8\n (Let (V \"zeroone\") (Lam (V \"x\")\n (If (Eq (Var (V \"x\")) (Val (Num 0)))\n (Val (Num 0))\n (Val (Num 1))))\n (Add (App (Var (V \"zeroone\")) (Val (Num 0)))\n (App (Var (V \"zeroone\")) (Val (Num 10)))))\n)\n(run 20)\n(check (= e8 (Val (Num 1))))\n(pop)\n", + "levenshtein-distance": "; Datatypes\n\n(datatype expr \n (Num i64)\n (Add expr expr)\n (Min expr expr expr))\n(rewrite (Add (Num a) (Num b)) (Num (+ a b)))\n(rewrite (Min (Num a) (Num b) (Num c)) (Num (min (min a b) c)))\n\n; `String` supports limited operations, let's just use it as a char type\n(datatype str\n (Cons String str))\n(function EmptyConst () str)\n(let Empty (EmptyConst))\n\n; Length function\n\n(function Length (str) expr)\n\n(rule ((= f (Length Empty)))\n ((union (Length Empty) (Num 0))))\n\n(rule ((= f (Length (Cons c cs))))\n ((union (Length (Cons c cs)) (Add (Num 1) (Length cs)))))\n\n; EditDist function\n\n(function EditDist (str str) expr)\n\n(rule ((= f (EditDist Empty s)))\n ((union (EditDist Empty s) (Length s))))\n\n(rule ((= f (EditDist s Empty)))\n ((union (EditDist s Empty) (Length s))))\n\n(rule ((= f (EditDist (Cons head rest1) (Cons head rest2))))\n ((union (EditDist (Cons head rest1) (Cons head rest2))\n (EditDist rest1 rest2))))\n\n(rule ((= f (EditDist (Cons head1 rest1) (Cons head2 rest2))) (!= head1 head2))\n ((union (EditDist (Cons head1 rest1) (Cons head2 rest2))\n (Add (Num 1)\n (Min (EditDist rest1 rest2)\n (EditDist (Cons head1 rest1) rest2)\n (EditDist rest1 (Cons head2 rest2)))))))\n\n; Unwrap function - turn a (Num n) into n\n\n(function Unwrap (expr) i64)\n(rule ((= x (Num n))) ((set (Unwrap (Num n)) n)))\n\n; Tests\n(let HorseStr (Cons \"h\" (Cons \"o\" (Cons \"r\" (Cons \"s\" (Cons \"e\" Empty))))))\n(let RosStr (Cons \"r\" (Cons \"o\" (Cons \"s\" Empty))))\n(let IntentionStr (Cons \"i\" (Cons \"n\" (Cons \"t\" (Cons \"e\" (Cons \"n\" (Cons \"t\" (Cons \"i\" (Cons \"o\" (Cons \"n\" Empty))))))))))\n(let ExecutionStr (Cons \"e\" (Cons \"x\" (Cons \"e\" (Cons \"c\" (Cons \"u\" (Cons \"t\" (Cons \"i\" (Cons \"o\" (Cons \"n\" Empty))))))))))\n\n(let Test1 (EditDist HorseStr RosStr))\n(let Test2 (EditDist IntentionStr ExecutionStr))\n(let Test3 (EditDist HorseStr Empty))\n\n(run 100)\n\n(extract (Unwrap Test1))\n(check (= Test1 (Num 3)))\n\n(extract (Unwrap Test2))\n(check (= Test2 (Num 5)))\n\n(extract (Unwrap Test3))\n(check (= Test3 (Num 5)))", + "list": "(datatype List\n\t(Nil)\n\t(Cons i64 List))\n\n(ruleset list)\n\n(function list-length (List) i64)\n(relation list-length-demand (List))\n(rule\n\t((list-length-demand (Nil)))\n\t((set (list-length (Nil)) 0))\n\t:ruleset list)\n(rule\n\t((list-length-demand (Cons head tail)))\n\t((list-length-demand tail))\n\t:ruleset list)\n(rule\n\t(\t(list-length-demand (Cons head tail))\n\t\t(= (list-length tail) tail-length))\n\t((set (list-length (Cons head tail)) (+ tail-length 1)))\n\t:ruleset list)\n\n(function list-get (List i64) i64)\n(relation list-get-demand (List i64))\n(rule\n\t(\t(list-get-demand list 0)\n\t\t(= list (Cons head tail)))\n\t((set (list-get list 0) head))\n\t:ruleset list)\n(rule\n\t(\t(list-get-demand list n) (> n 0)\n\t\t(= list (Cons head tail)))\n\t((list-get-demand tail (- n 1)))\n\t:ruleset list)\n(rule\n\t(\t(list-get-demand list n)\n\t\t(= list (Cons head tail))\n\t\t(= item (list-get tail (- n 1))))\n\t((set (list-get list n) item))\n\t:ruleset list)\n\n(function list-append (List List) List)\n(rewrite (list-append (Nil) list) list :ruleset list)\n(rewrite (list-append (Cons head tail) list) (Cons head (list-append tail list)) :ruleset list)\n\n; list-contains Nil _ => false\n; list-contains (Cons item tail) item => true\n; list-contains (Cons head tail) item => assert(head != item); (list-contains tail item)\n; list-contains needs inequality\n\n(function list-set (List i64 i64) List)\n(rewrite (list-set (Cons head tail) 0 item) (Cons item tail) :ruleset list)\n(rewrite (list-set (Cons head tail) i item) (Cons head (list-set tail (- i 1) item)) :when ((> i 0)) :ruleset list)\n\n; Tests\n(let a (Cons 1 (Cons 2 (Nil))))\n(let b (Cons 3 (Nil)))\n(let c (Cons 1 (Cons 2 (Cons 3 (Nil)))))\n(let d (Cons 1 (Cons 4 (Nil))))\n(let e (list-append a b))\n(let f (list-set a 1 4))\n\n(list-length-demand c)\n(list-get-demand b 0)\n(list-get-demand a 1)\n\n(run-schedule (saturate (run list)))\n\n(check (= e c))\n(check (= (list-length c) 3))\n(check (= (list-get b 0) 3))\n(check (= (list-get a 1) 2))\n(check (= f d))\n", + "map": "(sort MyMap (Map i64 String))\n\n(let my_map1 (map-insert (map-empty) 1 \"one\"))\n(let my_map2 (map-insert my_map1 2 \"two\"))\n\n(check (= \"one\" (map-get my_map1 1)))\n(query-extract my_map2)", + "math-microbenchmark": "(datatype Math\n (Diff Math Math)\n (Integral Math Math)\n \n (Add Math Math)\n (Sub Math Math)\n (Mul Math Math)\n (Div Math Math)\n (Pow Math Math)\n (Ln Math)\n (Sqrt Math)\n \n (Sin Math)\n (Cos Math)\n \n (Const Rational)\n (Var String))\n\n(rewrite (Add a b) (Add b a))\n(rewrite (Mul a b) (Mul b a))\n(rewrite (Add a (Add b c)) (Add (Add a b) c))\n(rewrite (Mul a (Mul b c)) (Mul (Mul a b) c))\n\n(rewrite (Sub a b) (Add a (Mul (Const (rational -1 1)) b)))\n;; (rewrite (Div a b) (Mul a (Pow b (Const (rational -1 1)))) :when ((is-not-zero b)))\n\n(rewrite (Add a (Const (rational 0 1))) a)\n(rewrite (Mul a (Const (rational 0 1))) (Const (rational 0 1)))\n(rewrite (Mul a (Const (rational 1 1))) a)\n\n(rewrite (Sub a a) (Const (rational 0 1)))\n\n(rewrite (Mul a (Add b c)) (Add (Mul a b) (Mul a c)))\n(rewrite (Add (Mul a b) (Mul a c)) (Mul a (Add b c)))\n\n(rewrite (Mul (Pow a b) (Pow a c)) (Pow a (Add b c)))\n(rewrite (Pow x (Const (rational 1 1))) x)\n(rewrite (Pow x (Const (rational 2 1))) (Mul x x))\n\n(rewrite (Diff x (Add a b)) (Add (Diff x a) (Diff x b)))\n(rewrite (Diff x (Mul a b)) (Add (Mul a (Diff x b)) (Mul b (Diff x a))))\n\n(rewrite (Diff x (Sin x)) (Cos x))\n(rewrite (Diff x (Cos x)) (Mul (Const (rational -1 1)) (Sin x)))\n\n(rewrite (Integral (Const (rational 1 1)) x) x)\n(rewrite (Integral (Cos x) x) (Sin x))\n(rewrite (Integral (Sin x) x) (Mul (Const (rational -1 1)) (Cos x)))\n(rewrite (Integral (Add f g) x) (Add (Integral f x) (Integral g x)))\n(rewrite (Integral (Sub f g) x) (Sub (Integral f x) (Integral g x)))\n(rewrite (Integral (Mul a b) x) \n(Sub (Mul a (Integral b x)) \n (Integral (Mul (Diff x a) (Integral b x)) x)))\n(Integral (Ln (Var \"x\")) (Var \"x\"))\n(Integral (Add (Var \"x\") (Cos (Var \"x\"))) (Var \"x\"))\n(Integral (Mul (Cos (Var \"x\")) (Var \"x\")) (Var \"x\"))\n(Diff (Var \"x\") (Add (Const (rational 1 1)) (Mul (Const (rational 2 1)) (Var \"x\"))))\n(Diff (Var \"x\") (Sub (Pow (Var \"x\") (Const (rational 3 1))) (Mul (Const (rational 7 1)) (Pow (Var \"x\") (Const (rational 2 1))))))\n(Add (Mul (Var \"y\") (Add (Var \"x\") (Var \"y\"))) (Sub (Add (Var \"x\") (Const (rational 2 1))) (Add (Var \"x\") (Var \"x\"))))\n(Div (Const (rational 1 1))\n (Sub (Div (Add (Const (rational 1 1))\n (Sqrt (Var \"five\")))\n (Const (rational 2 1)))\n (Div (Sub (Const (rational 1 1))\n (Sqrt (Var \"five\")))\n (Const (rational 2 1)))))\n(run 11)\n(print-size Add)\n(print-size Mul)\n\n(print-size)\n\n(print-stats)", + "math": "(datatype Math\n (Diff Math Math)\n (Integral Math Math)\n \n (Add Math Math)\n (Sub Math Math)\n (Mul Math Math)\n (Div Math Math)\n (Pow Math Math)\n (Ln Math)\n (Sqrt Math)\n \n (Sin Math)\n (Cos Math)\n \n (Const Rational)\n (Var String))\n\n(relation MathU (Math))\n(rule ((= e (Diff x y))) ((MathU e)))\n(rule ((= e (Integral x y))) ((MathU e)))\n(rule ((= e (Add x y))) ((MathU e)))\n(rule ((= e (Sub x y))) ((MathU e)))\n(rule ((= e (Mul x y))) ((MathU e)))\n(rule ((= e (Div x y))) ((MathU e)))\n(rule ((= e (Pow x y))) ((MathU e)))\n(rule ((= e (Ln x))) ((MathU e)))\n(rule ((= e (Sqrt x))) ((MathU e)))\n(rule ((= e (Sin x))) ((MathU e)))\n(rule ((= e (Cos x))) ((MathU e)))\n(rule ((= e (Const x))) ((MathU e)))\n(rule ((= e (Var x))) ((MathU e)))\n\n(relation evals-to (Math Rational))\n\n(rule ((= e (Const c))) ((evals-to e c)))\n(rule ((= e (Add a b)) (evals-to a va) (evals-to b vb))\n ((evals-to e (+ va vb))))\n(rule ((= e (Sub a b)) (evals-to a va) (evals-to b vb))\n ((evals-to e (- va vb))))\n(rule ((= e (Mul a b)) (evals-to a va) (evals-to b vb))\n ((evals-to e (* va vb))))\n(rule ((= e (Div a b)) (evals-to a va) (evals-to b vb) (!= vb (rational 0 1)))\n ((evals-to e (/ va vb))))\n(rule ((evals-to x vx)) ((union x (Const vx))))\n\n(relation is-const (Math))\n(rule ((evals-to a va)) ((is-const a)))\n\n(relation is-sym (Math))\n(rule ((= e (Var s))) ((is-sym e)))\n\n(relation is-not-zero (Math))\n(rule ((evals-to x vx)\n (!= vx (rational 0 1)))\n ((is-not-zero x)))\n\n(relation is-const-or-distinct-var-demand (Math Math))\n(relation is-const-or-distinct-var (Math Math))\n(rule ((is-const-or-distinct-var-demand v w)\n (is-const v))\n ((is-const-or-distinct-var v w)))\n(rule ((is-const-or-distinct-var-demand v w)\n (= v (Var vv))\n (= w (Var vw))\n (!= vv vw))\n ((is-const-or-distinct-var v w)))\n\n(rewrite (Add a b) (Add b a))\n(rewrite (Mul a b) (Mul b a))\n(rewrite (Add a (Add b c)) (Add (Add a b) c))\n(rewrite (Mul a (Mul b c)) (Mul (Mul a b) c))\n\n(rewrite (Sub a b) (Add a (Mul (Const (rational -1 1)) b)))\n(rewrite (Div a b) (Mul a (Pow b (Const (rational -1 1)))) :when ((is-not-zero b)))\n\n(rewrite (Add a (Const (rational 0 1))) a)\n(rewrite (Mul a (Const (rational 0 1))) (Const (rational 0 1)))\n(rewrite (Mul a (Const (rational 1 1))) a)\n\n;; NOTE: these two rules are different from math.rs, as math.rs does pruning\n(rule ((MathU a) (!= a (Const (rational 0 1)))) ((union a (Add a (Const (rational 0 1))))))\n(rule ((MathU a) (!= a (Const (rational 1 1)))) ((union a (Mul a (Const (rational 1 1))))))\n\n(rewrite (Sub a a) (Const (rational 0 1)))\n(rewrite (Div a a) (Const (rational 1 1)) :when ((is-not-zero a)))\n\n(rewrite (Mul a (Add b c)) (Add (Mul a b) (Mul a c)))\n(rewrite (Add (Mul a b) (Mul a c)) (Mul a (Add b c)))\n\n(rewrite (Mul (Pow a b) (Pow a c)) (Pow a (Add b c)))\n(rewrite (Pow x (Const (rational 0 1))) (Const (rational 1 1)) :when ((is-not-zero x)))\n(rewrite (Pow x (Const (rational 1 1))) x)\n(rewrite (Pow x (Const (rational 2 1))) (Mul x x))\n(rewrite (Pow x (Const (rational -1 1))) (Div (Const (rational 1 1)) x) :when ((is-not-zero x)))\n(rewrite (Mul x (Div (Const (rational 1 1)) x)) (Const (rational 1 1)) :when ((is-not-zero x)))\n\n(rewrite (Diff x x) (Const (rational 1 1)) :when ((is-sym x)))\n(rule ((= e (Diff x c))\n (is-sym x))\n ((is-const-or-distinct-var-demand c x)))\n(rewrite (Diff x c) (Const (rational 0 1)) :when ((is-sym x) (is-const-or-distinct-var c x)))\n\n(rewrite (Diff x (Add a b)) (Add (Diff x a) (Diff x b)))\n(rewrite (Diff x (Mul a b)) (Add (Mul a (Diff x b)) (Mul b (Diff x a))))\n\n(rewrite (Diff x (Sin x)) (Cos x))\n(rewrite (Diff x (Cos x)) (Mul (Const (rational -1 1)) (Sin x)))\n\n(rewrite (Diff x (Ln x)) (Div (Const (rational 1 1)) x) :when ((is-not-zero x)))\n\n(rewrite (Diff x (Pow f g))\n (Mul (Pow f g) \n (Add (Mul (Diff x f) (Div g f)) \n (Mul (Diff x g) (Ln f)))) \n :when ((is-not-zero f) \n (is-not-zero g)))\n\n(rewrite (Integral (Const (rational 1 1)) x) x)\n(rewrite (Integral (Pow x c) x)\n (Div (Pow x (Add c (Const (rational 1 1)))) (Add c (Const (rational 1 1)))) \n :when ((is-const c)))\n(rewrite (Integral (Cos x) x) (Sin x))\n(rewrite (Integral (Sin x) x) (Mul (Const (rational -1 1)) (Cos x)))\n(rewrite (Integral (Add f g) x) (Add (Integral f x) (Integral g x)))\n(rewrite (Integral (Sub f g) x) (Sub (Integral f x) (Integral g x)))\n(rewrite (Integral (Mul a b) x) \n (Sub (Mul a (Integral b x)) \n (Integral (Mul (Diff x a) (Integral b x)) x)))\n\n\n(let start-expr2 (Add (Const (rational 1 1))\n (Sub (Var \"a\") \n (Mul (Sub (Const (rational 2 1)) \n (Const (rational 1 1))) \n (Var \"a\")))))\n\n(run 6)\n\n(let end-expr2 (Const (rational 1 1)))\n\n(check (= start-expr2 end-expr2))\n\n(query-extract start-expr2)", + "matrix": "\n(datatype Dim (Times Dim Dim) (NamedDim String) (Lit i64))\n\n(rewrite (Times a (Times b c)) (Times (Times a b) c))\n(rewrite (Times (Times a b) c) (Times a (Times b c)) )\n(rewrite (Times (Lit i) (Lit j)) (Lit (* i j)))\n(rewrite (Times a b) (Times b a))\n\n(datatype MExpr\n (MMul MExpr MExpr)\n (Kron MExpr MExpr)\n (NamedMat String)\n (Id Dim)\n ; DSum\n ; HStack\n ; VStack\n ; Transpose\n ; Inverse\n ; Zero Math Math\n ; ScalarMul\n)\n\n; alternative encoding (type A) = (Matrix n m) may be more useful for \"large story example\"\n(function nrows (MExpr) Dim)\n(function ncols (MExpr) Dim)\n\n(rewrite (nrows (Kron A B)) (Times (nrows A) (nrows B)))\n(rewrite (ncols (Kron A B)) (Times (ncols A) (ncols B)))\n\n(rewrite (nrows (MMul A B)) (nrows A))\n(rewrite (ncols (MMul A B)) (ncols B))\n\n(rewrite (nrows (Id n)) n)\n(rewrite (ncols (Id n)) n)\n\n(rewrite (MMul (Id n) A) A)\n(rewrite (MMul A (Id n)) A)\n\n(rewrite (MMul A (MMul B C)) (MMul (MMul A B) C))\n(rewrite (MMul (MMul A B) C) (MMul A (MMul B C)))\n\n(rewrite (Kron A (Kron B C)) (Kron (Kron A B) C))\n(rewrite (Kron (Kron A B) C) (Kron A (Kron B C)))\n\n(rewrite (Kron (MMul A C) (MMul B D)) (MMul (Kron A B) (Kron C D)))\n\n\n(rewrite (MMul (Kron A B) (Kron C D))\n (Kron (MMul A C) (MMul B D))\n :when\n ((= (ncols A) (nrows C))\n (= (ncols B) (nrows D)))\n)\n\n; demand\n(rule ((= e (MMul A B)))\n((ncols A)\n(nrows A)\n(ncols B)\n(nrows B))\n)\n\n(rule ((= e (Kron A B)))\n((ncols A)\n(nrows A)\n(ncols B)\n(nrows B))\n)\n\n\n(let n (NamedDim \"n\"))\n(let m (NamedDim \"m\"))\n(let p (NamedDim \"p\"))\n\n(let A (NamedMat \"A\"))\n(let B (NamedMat \"B\"))\n(let C (NamedMat \"C\"))\n\n(union (nrows A) n)\n(union (ncols A) n)\n(union (nrows B) m)\n(union (ncols B) m)\n(union (nrows C) p)\n(union (ncols C) p)\n(let ex1 (MMul (Kron (Id n) B) (Kron A (Id m))))\n(let rows1 (nrows ex1))\n(let cols1 (ncols ex1))\n\n(run 20)\n\n(check (= (nrows B) m))\n(check (= (nrows (Kron (Id n) B)) (Times n m)))\n(let simple_ex1 (Kron A B))\n(check (= ex1 simple_ex1))\n\n(let ex2 (MMul (Kron (Id p) C) (Kron A (Id m))))\n(run 10)\n(fail (check (= ex2 (Kron A C))))\n", + "merge-during-rebuild": "; This file tests that non-union merges can be triggered during rebuilds as well\n; as \"inline\" during a set action. See issue #42\n\n(datatype N (Node i64))\n(function distance (N N) i64 :merge (min old new))\n\n(let a (Node 0))\n(let b (Node 1))\n(let x (Node 2))\n(let y (Node 3))\n(set (distance x y) 1)\n(set (distance a b) 2)\n\n(union a x)\n(union b y)\n\n(run 1)\n(check (= (distance x y) 1)) ; fails, the distance has gone up!\n", + "merge-saturates": "(function foo () i64 :merge (min old new))\n\n(set (foo) 0)\n\n; This should break at iteration 0 because the merge doesn't cause any updates\n(rule ((= f (foo))) ((set (foo) 1)))\n(run 100)\n\n\n; This should run for about 50 iterations, because even though the merge doesn't\n; change the value of baz, it has a side effect of expanding the domain of bar.\n\n(function baz (i64) i64 :default 0)\n\n(function bar () i64 :merge (min (baz new) 0))\n\n(set (bar) 1)\n(set (bar) 2)\n\n(rule ((= f (baz x)) (< x 50))\n ((set (bar) (+ x 1))))\n\n(run 100)\n(check (= 0 (baz 50)))\n", + "multiset": "(datatype Math (Num i64))\n(sort MathToMath (UnstableFn (Math) Math))\n(sort Maths (MultiSet Math))\n\n(let xs (multiset-of (Num 1) (Num 2) (Num 3)))\n\n;; verify equal to other ordering\n(check (=\n (multiset-of (Num 3) (Num 2) (Num 1))\n xs\n))\n\n;; verify not equal to different counts\n(check (!=\n (multiset-of (Num 3) (Num 2) (Num 1) (Num 1))\n xs\n))\n\n;; Unclear why check won't work if this is defined inline\n(let inserted (multiset-insert xs (Num 4)))\n;; insert\n(check (=\n (multiset-of (Num 1) (Num 2) (Num 3) (Num 4))\n inserted\n))\n\n\n;; contains and not contains\n(check (multiset-contains xs (Num 1)))\n(check (multiset-not-contains xs (Num 4)))\n\n;; remove last\n(check (=\n (multiset-of (Num 1) (Num 3))\n (multiset-remove xs (Num 2))\n))\n;; remove one of\n(check (= (multiset-of (Num 1)) (multiset-remove (multiset-of (Num 1) (Num 1)) (Num 1))))\n\n\n;; length\n(check (= 3 (multiset-length xs)))\n;; length repeated\n(check (= 3 (multiset-length (multiset-of (Num 1) (Num 1) (Num 1)))))\n\n;; pick\n(check (= (Num 1) (multiset-pick (multiset-of (Num 1)))))\n\n;; map\n(function square (Math) Math)\n(rewrite (square (Num x)) (Num (* x x)))\n\n(let squared-xs (unstable-multiset-map (unstable-fn \"square\") xs))\n(run 1)\n(check (=\n (multiset-of (Num 1) (Num 4) (Num 9))\n squared-xs\n))\n", + "name-resolution": "(datatype Math\n (Add Math Math)\n (Num i64))\n \n(let zero (Num 0))\n\n\n;; zero here refers to the function/constant zero, not a free variable\n(rewrite (Add zero x) x)\n\n(let a (Add (Num 0) (Num 3)))\n(let b (Add (Num 7) (Num 9)))\n(let c (Num 16))\n(union b c)\n\n;; crash if we merge two numbers\n(rule (\n (= (Num x) (Num y))\n (!= x y)\n)(\n (panic \"ahhh\")\n))\n \n \n(run 10)", + "path-union": "(datatype Node\n (mk i64))\n\n(relation edge (Node Node))\n(relation path (Node Node))\n \n(rule ((edge x y))\n ((path x y)))\n\n(rule ((path x y) (edge y z))\n ((path x z)))\n\n(edge (mk 1) (mk 2))\n(edge (mk 2) (mk 3))\n(edge (mk 5) (mk 6))\n\n(union (mk 3) (mk 5))\n\n(run 10)\n(check (edge (mk 3) (mk 6)))\n(check (path (mk 1) (mk 6)))", + "path": "(relation path (i64 i64))\n(relation edge (i64 i64))\n\n(rule ((edge x y))\n ((path x y)))\n\n(rule ((path x y) (edge y z))\n ((path x z)))\n \n(edge 1 2)\n(edge 2 3)\n(edge 3 4)\n(check (edge 1 2))\n(fail (check (path 1 2)))\n(run 3)\n\n(print-function path 100)\n(check (path 1 4))\n(fail (check (path 4 1)))\n", + "pathproof": "; proofs of connectivity are paths\n(datatype Proof\n (Trans i64 Proof)\n (Edge i64 i64))\n\n; We enhance the path relation to carry a proof field\n(relation path (i64 i64 Proof))\n(relation edge (i64 i64))\n\n(edge 2 1)\n(edge 3 2)\n(edge 1 3)\n\n(rule ((edge x y)) \n ((path x y (Edge x y))))\n(rule ((edge x y) (path y z p)) \n ((path x z (Trans x p))))\n\n; We consider equal all paths tha connect same points.\n; Smallest Extraction will extract shortest path.\n(rule ((path x y p1) (path x y p2)) \n ((union p1 p2)))\n\n(run 3)\n(check (path 3 1 (Trans 3 (Edge 2 1))))\n; Would prefer being able to check\n;(check (path 1 2 _))\n; or extract\n;(query-extract (path 1 4 ?p))\n(print-function path 100)", + "points-to": "; Identifiers represented as strings, keep some newtypes around to aid clarity\n(datatype ClassT (Class String))\n(datatype FieldT (Field String))\n\n(datatype Stmt\n (New String ClassT)\n ; Assign dst src\n (Assign String String)\n ; Store dst field src\n (Store String FieldT String)\n ; Load dst src field\n (Load String String FieldT))\n\n(relation VarPointsTo (String ClassT))\n(relation HeapPointsTo (ClassT FieldT ClassT))\n\n; New variables point to classes they're initialized as\n(rule ((= x (New a b))) ((VarPointsTo a b)))\n\n; If I assign v1 <- v2 and v2 points to a class c2, then v1 points to class c2\n; as well\n(rule ((= x (Assign v1 v2)) (VarPointsTo v2 c2))\n ((VarPointsTo v1 c2)))\n\n; If c1.f points to c2, and v2 points to class c1, then assigning v1 <- v2.f\n; means v1 points to c2\n(rule ((= x (Load v1 v2 f)) \n (VarPointsTo v2 c1)\n (HeapPointsTo c1 f c2))\n ((VarPointsTo v1 c2)))\n\n; If v1 points to class c1, and v2 to c2, and if v1.f <- v2, then c1.f points to\n; c2\n(rule ((= x (Store v1 f v2))\n (VarPointsTo v1 c1)\n (VarPointsTo v2 c2))\n ((HeapPointsTo c1 f c2)))\n\n; Example in \"From Datalog to Flix\"\n; l1: ClassA o1 = new ClassA();\n; l2: ClassB o2 = new ClassB();\n; l3: ClassB o3 = o2;\n; l4: o2.f = o1;\n; l5: Object r = o3.f;\n\n(let A (Class \"A\"))\n(let B (Class \"B\"))\n(let f (Field \"f\"))\n\n(let l1 (New \"o1\" A))\n(let l2 (New \"o2\" B))\n(let l3 (Assign \"o3\" \"o2\"))\n(let l4 (Store \"o2\" f \"o1\"))\n(let l5 (Load \"r\" \"o3\" f))\n\n(run 3)\n\n(check (VarPointsTo \"o1\" A))\n(check (VarPointsTo \"o2\" B))\n\n(check (VarPointsTo \"o3\" B))\n(check (HeapPointsTo B f A))\n(check (VarPointsTo \"r\" A))", + "primitives": "(check (= (+ 2 2) 4))\n(check (= (- 2 1) 1))\n(check (= (- 1 2) -1))\n(check (< 1 2))\n(check (> 1 -2))", + "prims": "; A nasty, imperative implementation of Prim's algorithm... in egglog!\n; https://en.wikipedia.org/wiki/Prim%27s_algorithm\n\n; Weighted edge (vertex 1 * vertex 2 * weight)\n(datatype edge (Edge i64 i64 i64))\n(relation edge-exists (edge))\n\n(relation mytrue ())\n(mytrue)\n(let infinity 99999999) ; close enough\n\n; ==== PROBLEM INSTANCES ====\n\n; Graph 1\n; (1)--2--(2)\n; \\ |\n; 1 2\n; \\ |\n; (3)--3--(4)\n(ruleset graph1)\n(rule ((mytrue))\n ((edge-exists (Edge 1 2 2))\n (edge-exists (Edge 1 4 1))\n (edge-exists (Edge 2 4 2))\n (edge-exists (Edge 3 4 3)))\n :ruleset graph1)\n\n; Graph 2\n; (1)-2-(2) (3)\n; |\\ /| / |\n; | 3 5 | 4 |\n; 5 X 2 / 5\n; | / \\ |/ |\n; (4)-4-(5)-7-(6)\n(ruleset graph2)\n(rule ((mytrue))\n ((edge-exists (Edge 1 2 1))\n (edge-exists (Edge 1 4 5))\n (edge-exists (Edge 1 5 3))\n (edge-exists (Edge 2 4 5))\n (edge-exists (Edge 2 5 2))\n (edge-exists (Edge 3 5 4))\n (edge-exists (Edge 3 6 5))\n (edge-exists (Edge 4 5 4))\n (edge-exists (Edge 5 6 7)))\n :ruleset graph2)\n\n; ==== \"INIT\" RULESET ====\n\n(ruleset init)\n\n; Graph is undirected\n(rule ((= e (Edge x y weight)))\n ((union e (Edge y x weight)))\n :ruleset init)\n\n; Whether a vertex is included *so far* (this changes). Returns 0 or 1.\n(function vertex-included (i64) i64 :merge (max old new))\n\n; All vertices default to being not included (note vertex-included's :merge)\n(rule ((edge-exists (Edge x y weight)))\n ((set (vertex-included x) 0))\n :ruleset init)\n\n; Keep track of the current iteration\n(function current-iteration () i64 :merge (max old new))\n\n; Map iteration to best edge found so far\n(function iteration-to-best-edge (i64) edge :merge new)\n(function iteration-to-best-edge-weight (i64) i64 :merge new)\n\n(rule ((mytrue))\n ((set (vertex-included 1) 1) ; Initially just include vertex 1\n (set (current-iteration) 0)\n (set (iteration-to-best-edge-weight 0) infinity))\n :ruleset init)\n\n; === \"CHOOSE BEST EDGE\" RULESET ===\n\n(relation edge-in-mst (edge)) ; whether an edge is in our solution\n\n(ruleset choose-best-edge)\n(rule ((= i (current-iteration))\n (edge-exists (Edge x y weight))\n (= 1 (vertex-included x))\n (= 0 (vertex-included y))\n (< weight (iteration-to-best-edge-weight i)))\n ((set (iteration-to-best-edge-weight i) weight)\n (set (iteration-to-best-edge i) (Edge x y weight)))\n :ruleset choose-best-edge)\n\n; === \"FINISH ITERATION\" RULESET ===\n\n(ruleset finish-iteration)\n(rule ((= i (current-iteration))\n (= (Edge x y weight) (iteration-to-best-edge i)))\n ((edge-in-mst (Edge x y weight)) ; incorporate chosen best edge\n (set (vertex-included x) 1) ; mark its vertices as included\n (set (vertex-included y) 1)\n (set (current-iteration) (+ i 1)) ; advance iteration\n (set (iteration-to-best-edge-weight (+ i 1)) infinity))\n :ruleset finish-iteration)\n\n; === RUN VIA SCHEDULE ===\n\n(run-schedule\n (saturate init graph1) ; change to graph2 to see other example\n (saturate (saturate choose-best-edge) finish-iteration)\n)\n\n; === PRINT RESULTS ===\n\n; (print-function edge-in-mst) ; this is not very helpful\n\n; Just copy canonical edges to solution\n(relation solution (i64 i64 i64))\n\n(ruleset finalize)\n(rule ((edge-in-mst (Edge x y weight)) (< x y))\n ((solution x y weight))\n :ruleset finalize)\n(run-schedule (saturate finalize))\n\n(print-function solution 100) ; this is better\n", + "push-pop": "(function foo () i64 :merge (max old new))\n\n(set (foo) 1)\n(check (= (foo) 1))\n\n(push)\n(set (foo) 2)\n(check (= (foo) 2))\n(pop)\n\n(check (= (foo) 1))", + "python_array_optimize": ";; created by `python python/tests/test_array_api.py`\n(push 1)\n(sort DType)\n(function DType_float64 () DType)\n(let %__expr_2565664028803046192 (DType_float64))\n(sort Boolean)\n(function DType___eq__ (DType DType) Boolean)\n(sort NDArray)\n(function NDArray_dtype (NDArray) DType)\n(function assume_isfinite (NDArray) NDArray)\n(sort TupleInt)\n(function assume_shape (NDArray TupleInt) NDArray)\n(function assume_dtype (NDArray DType) NDArray)\n(function NDArray_var (String) NDArray :cost 200)\n(sort Int)\n(sort Vec_Int (Vec Int))\n(function TupleInt_from_vec (Vec_Int) TupleInt)\n(function Int___init__ (i64) Int)\n(DType___eq__ %__expr_2565664028803046192 (NDArray_dtype (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4)))))))\n(ruleset array_api_ruleset)\n(function i-Int__-Int_i (Int Int) Int)\n(rewrite (i-Int__-Int_i i _) i :ruleset array_api_ruleset)\n(function TupleInt_single (Int) TupleInt)\n(sort UnstableFn_Int_Int (UnstableFn (Int) Int))\n(function TupleInt___init__ (Int UnstableFn_Int_Int) TupleInt :unextractable)\n(rewrite (TupleInt_single i) (TupleInt___init__ (Int___init__ 1) (unstable-fn \"i-Int__-Int_i\" i)) :ruleset array_api_ruleset)\n(function i-Int_i (Int) Int)\n(rewrite (i-Int_i i) i :ruleset array_api_ruleset)\n(function TupleInt_range (Int) TupleInt)\n(rewrite (TupleInt_range stop) (TupleInt___init__ stop (unstable-fn \"i-Int_i\")) :ruleset array_api_ruleset)\n(function index_vec_int (Vec_Int Int) Int)\n(rewrite (TupleInt_from_vec vec) (TupleInt___init__ (Int___init__ (vec-length vec)) (unstable-fn \"index_vec_int\" vec)) :ruleset array_api_ruleset)\n(function Int_if_ (Boolean Int Int) Int)\n(function Int___lt__ (Int Int) Boolean)\n(function TupleInt_length (TupleInt) Int)\n(function TupleInt___getitem__ (TupleInt Int) Int)\n(function Int___sub__ (Int Int) Int)\n(function other-TupleInt_self-TupleInt_i-Int__Int_if___Int___lt___i__TupleInt_length_self____TupleInt___getitem___self_i___TupleInt___getitem___other__Int___sub___i__TupleInt_length_self____ (TupleInt TupleInt Int) Int)\n(rewrite (other-TupleInt_self-TupleInt_i-Int__Int_if___Int___lt___i__TupleInt_length_self____TupleInt___getitem___self_i___TupleInt___getitem___other__Int___sub___i__TupleInt_length_self____ other self i) (Int_if_ (Int___lt__ i (TupleInt_length self)) (TupleInt___getitem__ self i) (TupleInt___getitem__ other (Int___sub__ i (TupleInt_length self)))) :ruleset array_api_ruleset)\n(function TupleInt___add__ (TupleInt TupleInt) TupleInt)\n(function Int___add__ (Int Int) Int)\n(rewrite (TupleInt___add__ self other) (TupleInt___init__ (Int___add__ (TupleInt_length self) (TupleInt_length other)) (unstable-fn \"other-TupleInt_self-TupleInt_i-Int__Int_if___Int___lt___i__TupleInt_length_self____TupleInt___getitem___self_i___TupleInt___getitem___other__Int___sub___i__TupleInt_length_self____\" other self)) :ruleset array_api_ruleset)\n(function Boolean___or__ (Boolean Boolean) Boolean)\n(function Int___eq__ (Int Int) Boolean)\n(function i-Int_acc-Boolean_j-Int__Boolean___or___acc__Int___eq___i_j__ (Int Boolean Int) Boolean)\n(rewrite (i-Int_acc-Boolean_j-Int__Boolean___or___acc__Int___eq___i_j__ i acc j) (Boolean___or__ acc (Int___eq__ i j)) :ruleset array_api_ruleset)\n(function TupleInt_contains (TupleInt Int) Boolean)\n(sort UnstableFn_Boolean_Boolean_Int (UnstableFn (Boolean Int) Boolean))\n(function TupleInt_fold_boolean (TupleInt Boolean UnstableFn_Boolean_Boolean_Int) Boolean)\n(function FALSE () Boolean)\n(rewrite (TupleInt_contains self i) (TupleInt_fold_boolean self (FALSE) (unstable-fn \"i-Int_acc-Boolean_j-Int__Boolean___or___acc__Int___eq___i_j__\" i)) :ruleset array_api_ruleset)\n(function f-UnstableFn_Int_Int_self-TupleInt_i-Int__unstable-app_f__TupleInt___getitem___self_i__ (UnstableFn_Int_Int TupleInt Int) Int)\n(rewrite (f-UnstableFn_Int_Int_self-TupleInt_i-Int__unstable-app_f__TupleInt___getitem___self_i__ f self i) (unstable-app f (TupleInt___getitem__ self i)) :ruleset array_api_ruleset)\n(function TupleInt_map (TupleInt UnstableFn_Int_Int) TupleInt :cost 100)\n(rewrite (TupleInt_map self f) (TupleInt___init__ (TupleInt_length self) (unstable-fn \"f-UnstableFn_Int_Int_self-TupleInt_i-Int__unstable-app_f__TupleInt___getitem___self_i__\" f self)) :ruleset array_api_ruleset)\n(function NDArray_size (NDArray) Int)\n(sort UnstableFn_Int_Int_Int (UnstableFn (Int Int) Int))\n(function TupleInt_fold (TupleInt Int UnstableFn_Int_Int_Int) Int)\n(function NDArray_shape (NDArray) TupleInt)\n(function Int___mul__ (Int Int) Int)\n(rewrite (NDArray_size x) (TupleInt_fold (NDArray_shape x) (Int___init__ 1) (unstable-fn \"Int___mul__\")) :ruleset array_api_ruleset)\n(function unique_values (NDArray) NDArray)\n(sort TupleValue)\n(function NDArray_vector (TupleValue) NDArray)\n(sort Value)\n(function possible_values (Value) TupleValue)\n(function NDArray_index (NDArray TupleInt) Value)\n(function ALL_INDICES () TupleInt)\n(rewrite (unique_values a) (NDArray_vector (possible_values (NDArray_index a (ALL_INDICES)))) :ruleset array_api_ruleset)\n(function Value_isfinite (Value) Boolean)\n(function Value_int (Int) Value)\n(function TRUE () Boolean)\n(rewrite (Value_isfinite (Value_int i)) (TRUE) :ruleset array_api_ruleset)\n(function Value_bool (Boolean) Value)\n(rewrite (Value_isfinite (Value_bool b)) (TRUE) :ruleset array_api_ruleset)\n(sort Float)\n(function Value_float (Float) Value)\n(function Float___init__ (f64) Float :cost 3)\n(rewrite (Value_isfinite (Value_float (Float___init__ f))) (TRUE) :when ((!= f NaN)) :ruleset array_api_ruleset)\n(function isfinite (NDArray) NDArray)\n(sort OptionalIntOrTuple)\n(function sum (NDArray OptionalIntOrTuple) NDArray)\n(function OptionalIntOrTuple_none () OptionalIntOrTuple)\n(function NDArray_scalar (Value) NDArray)\n(rewrite (isfinite (sum arr (OptionalIntOrTuple_none))) (NDArray_scalar (Value_bool (Value_isfinite (NDArray_index arr (ALL_INDICES))))) :ruleset array_api_ruleset)\n(function assume_value_one_of (NDArray TupleValue) NDArray)\n(rewrite (NDArray_shape (assume_value_one_of x vs)) (NDArray_shape x) :ruleset array_api_ruleset)\n(rewrite (NDArray_dtype (assume_value_one_of x vs)) (NDArray_dtype x) :ruleset array_api_ruleset)\n(rule ((= v (NDArray_index (assume_value_one_of x vs) idx)))\n ((union v (NDArray_index x idx))\n (union (possible_values v) vs))\n :ruleset array_api_ruleset )\n(rewrite (NDArray_shape (assume_isfinite x)) (NDArray_shape x) :ruleset array_api_ruleset)\n(rewrite (NDArray_dtype (assume_isfinite x)) (NDArray_dtype x) :ruleset array_api_ruleset)\n(rewrite (NDArray_index (assume_isfinite x) ti) (NDArray_index x ti) :ruleset array_api_ruleset)\n(rewrite (Value_isfinite (NDArray_index (assume_isfinite x) ti)) (TRUE) :ruleset array_api_ruleset)\n(rewrite (NDArray_shape (assume_shape x shape)) shape :ruleset array_api_ruleset)\n(rewrite (NDArray_dtype (assume_shape x shape)) (NDArray_dtype x) :ruleset array_api_ruleset)\n(rewrite (NDArray_index (assume_shape x shape) idx) (NDArray_index x idx) :ruleset array_api_ruleset)\n(rewrite (NDArray_dtype (assume_dtype x dtype)) dtype :ruleset array_api_ruleset)\n(rewrite (NDArray_shape (assume_dtype x dtype)) (NDArray_shape x) :ruleset array_api_ruleset)\n(rewrite (NDArray_index (assume_dtype x dtype) idx) (NDArray_index x idx) :ruleset array_api_ruleset)\n(sort IndexKey)\n(function NDArray___getitem__ (NDArray IndexKey) NDArray)\n(function IndexKey_int (Int) IndexKey)\n(rewrite (NDArray___getitem__ x (IndexKey_int i)) (NDArray_scalar (NDArray_index x (TupleInt_single i))) :ruleset array_api_ruleset)\n(sort OptionalBool)\n(function reshape (NDArray TupleInt OptionalBool) NDArray)\n(rule ((= __a (reshape x shape copy)))\n ((NDArray_shape x)\n (TupleInt_length (NDArray_shape x)))\n :ruleset array_api_ruleset )\n(rule ((reshape x shape copy))\n ((TupleInt_length shape)\n (TupleInt___getitem__ shape (Int___init__ 0)))\n :ruleset array_api_ruleset )\n(rewrite (reshape x shape copy) x :when ((= (TupleInt_length (NDArray_shape x)) (Int___init__ 1)) (= (TupleInt_length shape) (Int___init__ 1)) (= (TupleInt___getitem__ shape (Int___init__ 0)) (Int___init__ -1))) :ruleset array_api_ruleset)\n(function TupleValue_length (TupleValue) Int)\n(rewrite (NDArray_shape (NDArray_vector vs)) (TupleInt_single (TupleValue_length vs)) :ruleset array_api_ruleset)\n(function Value_dtype (Value) DType)\n(function TupleValue___getitem__ (TupleValue Int) Value)\n(rewrite (NDArray_dtype (NDArray_vector vs)) (Value_dtype (TupleValue___getitem__ vs (Int___init__ 0))) :ruleset array_api_ruleset)\n(rewrite (NDArray_index (NDArray_vector vs) ti) (TupleValue___getitem__ vs (TupleInt___getitem__ ti (Int___init__ 0))) :ruleset array_api_ruleset)\n(function TupleInt_EMPTY () TupleInt)\n(rewrite (NDArray_shape (NDArray_scalar v)) (TupleInt_EMPTY) :ruleset array_api_ruleset)\n(rewrite (NDArray_dtype (NDArray_scalar v)) (Value_dtype v) :ruleset array_api_ruleset)\n(rewrite (NDArray_index (NDArray_scalar v) (TupleInt_EMPTY)) v :ruleset array_api_ruleset)\n(function any (NDArray) NDArray)\n(function TupleValue_includes (TupleValue Value) Boolean)\n(function Value_to_truthy_value (Value) Value)\n(rewrite (any x) (NDArray_scalar (Value_bool (TupleValue_includes (possible_values (Value_to_truthy_value (NDArray_index x (ALL_INDICES)))) (Value_bool (TRUE))))) :ruleset array_api_ruleset)\n(function NDArray___lt__ (NDArray NDArray) NDArray)\n(function Value___lt__ (Value Value) Value)\n(function broadcast_index (TupleInt TupleInt TupleInt) TupleInt)\n(function broadcast_shapes (TupleInt TupleInt) TupleInt)\n(rewrite (NDArray_index (NDArray___lt__ x y) idx) (Value___lt__ (NDArray_index x (broadcast_index (NDArray_shape x) (broadcast_shapes (NDArray_shape x) (NDArray_shape y)) idx)) (NDArray_index y (broadcast_index (NDArray_shape y) (broadcast_shapes (NDArray_shape x) (NDArray_shape y)) idx))) :ruleset array_api_ruleset)\n(function NDArray___truediv__ (NDArray NDArray) NDArray)\n(function Value___truediv__ (Value Value) Value)\n(rewrite (NDArray_index (NDArray___truediv__ x y) idx) (Value___truediv__ (NDArray_index x (broadcast_index (NDArray_shape x) (broadcast_shapes (NDArray_shape x) (NDArray_shape y)) idx)) (NDArray_index y (broadcast_index (NDArray_shape y) (broadcast_shapes (NDArray_shape x) (NDArray_shape y)) idx))) :ruleset array_api_ruleset)\n(rewrite (NDArray_index (NDArray_scalar v) idx) v :ruleset array_api_ruleset)\n(function astype (NDArray DType) NDArray)\n(function Value_astype (Value DType) Value)\n(rewrite (NDArray_index (astype x dtype) idx) (Value_astype (NDArray_index x idx) dtype) :ruleset array_api_ruleset)\n(relation greater_zero (Value))\n(sort TupleNDArray)\n(function TupleNDArray___getitem__ (TupleNDArray Int) NDArray)\n(function unique_counts (NDArray) TupleNDArray)\n(rule ((= v (NDArray_index (TupleNDArray___getitem__ (unique_counts x) (Int___init__ 1)) idx)))\n ((greater_zero v))\n :ruleset array_api_ruleset )\n(rule ((greater_zero v)\n (= v1 (Value_astype v dtype)))\n ((greater_zero v1))\n :ruleset array_api_ruleset )\n(rule ((= v (Value_float (Float___init__ f)))\n (> f 0.0))\n ((greater_zero v))\n :ruleset array_api_ruleset )\n(rule ((= v (Value_int (Int___init__ i)))\n (> i 0))\n ((greater_zero v))\n :ruleset array_api_ruleset )\n(rule ((greater_zero v)\n (greater_zero v1)\n (= v2 (Value___truediv__ v v1)))\n ((greater_zero v2))\n :ruleset array_api_ruleset )\n(rule ((greater_zero v)\n (= v1 (Value___lt__ v (Value_int (Int___init__ 0)))))\n ((union v1 (Value_bool (FALSE))))\n :ruleset array_api_ruleset )\n(function TupleValue___init__ (Value) TupleValue)\n(rewrite (possible_values (Value_bool b)) (TupleValue___init__ (Value_bool b)) :ruleset array_api_ruleset)\n(rule ((= v1 (Value_astype v dtype))\n (greater_zero v))\n ((greater_zero v1))\n :ruleset array_api_ruleset )\n(function TupleNDArray_length (TupleNDArray) Int)\n(function svd (NDArray Boolean) TupleNDArray)\n(rewrite (TupleNDArray_length (svd x full_matrices)) (Int___init__ 3) :ruleset array_api_ruleset)\n(function unique_inverse (NDArray) TupleNDArray)\n(rewrite (TupleNDArray_length (unique_inverse x)) (Int___init__ 2) :ruleset array_api_ruleset)\n(rewrite (TupleNDArray___getitem__ (unique_inverse x) (Int___init__ 0)) (unique_values x) :ruleset array_api_ruleset)\n(function ndarray-abs (NDArray) NDArray)\n(function Float_abs (Float) Float)\n(rewrite (ndarray-abs (NDArray_scalar (Value_float f))) (NDArray_scalar (Value_float (Float_abs f))) :ruleset array_api_ruleset)\n(rewrite (TupleNDArray_length (unique_counts x)) (Int___init__ 2) :ruleset array_api_ruleset)\n(rewrite (sum (TupleNDArray___getitem__ (unique_counts x) (Int___init__ 1)) (OptionalIntOrTuple_none)) (NDArray_scalar (Value_int (NDArray_size x))) :ruleset array_api_ruleset)\n(rewrite (sum (astype (TupleNDArray___getitem__ (unique_counts x) (Int___init__ 1)) dtype) (OptionalIntOrTuple_none)) (astype (NDArray_scalar (Value_int (NDArray_size x))) dtype) :ruleset array_api_ruleset)\n(rewrite (NDArray_dtype (astype x dtype)) dtype :ruleset array_api_ruleset)\n(rewrite (astype (NDArray_scalar (Value_int (Int___init__ i))) %__expr_2565664028803046192) (NDArray_scalar (Value_float (Float___init__ (to-f64 i)))) :ruleset array_api_ruleset)\n(sort OptionalInt)\n(function concat (TupleNDArray OptionalInt) NDArray)\n(function TupleNDArray___init__ (NDArray) TupleNDArray)\n(function OptionalInt_none () OptionalInt)\n(rewrite (concat (TupleNDArray___init__ x) (OptionalInt_none)) x :ruleset array_api_ruleset)\n(rewrite (unique_values (unique_values x)) (unique_values x) :ruleset array_api_ruleset)\n(rewrite (sum (NDArray___truediv__ x (NDArray_scalar v)) (OptionalIntOrTuple_none)) (NDArray___truediv__ (sum x (OptionalIntOrTuple_none)) (NDArray_scalar v)) :ruleset array_api_ruleset)\n(function NDArray_ndim (NDArray) Int)\n(sort OptionalDType)\n(sort OptionalDevice)\n(function asarray (NDArray OptionalDType OptionalBool OptionalDevice) NDArray)\n(function OptionalDevice_none () OptionalDevice)\n(rewrite (NDArray_ndim (asarray a d ob (OptionalDevice_none))) (NDArray_ndim a) :ruleset array_api_ruleset)\n(function OptionalDType_none () OptionalDType)\n(function OptionalBool_none () OptionalBool)\n(rewrite (asarray a (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) a :ruleset array_api_ruleset)\n(function TupleNDArray___add__ (TupleNDArray TupleNDArray) TupleNDArray)\n(function TupleNDArray_EMPTY () TupleNDArray)\n(rewrite (TupleNDArray___add__ ti (TupleNDArray_EMPTY)) ti :ruleset array_api_ruleset)\n(rewrite (TupleNDArray_length (TupleNDArray___init__ n)) (Int___init__ 1) :ruleset array_api_ruleset)\n(rewrite (TupleNDArray_length (TupleNDArray___add__ ti ti2)) (Int___add__ (TupleNDArray_length ti) (TupleNDArray_length ti2)) :ruleset array_api_ruleset)\n(sort UnstableFn_Value_TupleInt (UnstableFn (TupleInt) Value))\n(function NDArray___init__ (TupleInt DType UnstableFn_Value_TupleInt) NDArray)\n(rewrite (NDArray_shape (NDArray___init__ shape dtype idx_fn)) shape :ruleset array_api_ruleset)\n(rewrite (NDArray_dtype (NDArray___init__ shape dtype idx_fn)) dtype :ruleset array_api_ruleset)\n(rewrite (NDArray_ndim x) (TupleInt_length (NDArray_shape x)) :ruleset array_api_ruleset)\n(function NDArray_to_value (NDArray) Value)\n(rewrite (NDArray_to_value x) (NDArray_index x (TupleInt_EMPTY)) :ruleset array_api_ruleset)\n(rewrite (NDArray___truediv__ (NDArray_scalar (Value_float f)) (NDArray_scalar (Value_float f))) (NDArray_scalar (Value_float (Float___init__ 1.0))) :ruleset array_api_ruleset)\n(function NDArray___sub__ (NDArray NDArray) NDArray)\n(rewrite (NDArray___sub__ (NDArray_scalar (Value_float f)) (NDArray_scalar (Value_float f))) (NDArray_scalar (Value_float (Float___init__ 0.0))) :ruleset array_api_ruleset)\n(function NDArray___gt__ (NDArray NDArray) NDArray)\n(rewrite (NDArray___gt__ (NDArray_scalar (Value_float (Float___init__ fi1))) (NDArray_scalar (Value_float (Float___init__ fi2)))) (NDArray_scalar (Value_bool (TRUE))) :when ((> fi1 fi2)) :ruleset array_api_ruleset)\n(rewrite (NDArray___gt__ (NDArray_scalar (Value_float (Float___init__ fi1))) (NDArray_scalar (Value_float (Float___init__ fi2)))) (NDArray_scalar (Value_bool (FALSE))) :when ((<= fi1 fi2)) :ruleset array_api_ruleset)\n(function NDArray_T (NDArray) NDArray)\n(rewrite (NDArray_T (NDArray_T x)) x :ruleset array_api_ruleset)\n(function TupleValue___add__ (TupleValue TupleValue) TupleValue)\n(function TupleValue_EMPTY () TupleValue)\n(rewrite (TupleValue___add__ ti (TupleValue_EMPTY)) ti :ruleset array_api_ruleset)\n(rewrite (TupleValue_length (TupleValue_EMPTY)) (Int___init__ 0) :ruleset array_api_ruleset)\n(rewrite (TupleValue_length (TupleValue___init__ v)) (Int___init__ 1) :ruleset array_api_ruleset)\n(rewrite (TupleValue_length (TupleValue___add__ ti ti2)) (Int___add__ (TupleValue_length ti) (TupleValue_length ti2)) :ruleset array_api_ruleset)\n(rewrite (TupleValue___getitem__ (TupleValue___init__ v) (Int___init__ 0)) v :ruleset array_api_ruleset)\n(rewrite (TupleValue___getitem__ (TupleValue___add__ (TupleValue___init__ v) ti) (Int___init__ 0)) v :ruleset array_api_ruleset)\n(rule ((= v (TupleValue___getitem__ (TupleValue___add__ (TupleValue___init__ v2) ti) (Int___init__ k)))\n (> k 0))\n ((union v (TupleValue___getitem__ ti (Int___init__ (- k 1)))))\n :ruleset array_api_ruleset )\n(rewrite (TupleValue_includes (TupleValue_EMPTY) v) (FALSE) :ruleset array_api_ruleset)\n(rewrite (TupleValue_includes (TupleValue___init__ v) v) (TRUE) :ruleset array_api_ruleset)\n(rewrite (TupleValue_includes (TupleValue___init__ v) v2) (FALSE) :when ((!= v v2)) :ruleset array_api_ruleset)\n(rewrite (TupleValue_includes (TupleValue___add__ ti ti2) v) (Boolean___or__ (TupleValue_includes ti v) (TupleValue_includes ti2 v)) :ruleset array_api_ruleset)\n(function DType_int64 () DType)\n(rewrite (Value_dtype (Value_int i)) (DType_int64) :ruleset array_api_ruleset)\n(rewrite (Value_dtype (Value_float f)) %__expr_2565664028803046192 :ruleset array_api_ruleset)\n(function DType_bool () DType)\n(rewrite (Value_dtype (Value_bool b)) (DType_bool) :ruleset array_api_ruleset)\n(function Value_to_bool (Value) Boolean)\n(rewrite (Value_to_bool (Value_bool b)) b :ruleset array_api_ruleset)\n(function Value_to_int (Value) Int)\n(rewrite (Value_to_int (Value_int i)) i :ruleset array_api_ruleset)\n(rewrite (Value_to_truthy_value (Value_bool b)) (Value_bool b) :ruleset array_api_ruleset)\n(sort IsDtypeKind)\n(function isdtype (DType IsDtypeKind) Boolean)\n(function DType_float32 () DType)\n(function IsDtypeKind_string (String) IsDtypeKind)\n(rewrite (isdtype (DType_float32) (IsDtypeKind_string \"integral\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype %__expr_2565664028803046192 (IsDtypeKind_string \"integral\")) (FALSE) :ruleset array_api_ruleset)\n(function DType_object () DType)\n(rewrite (isdtype (DType_object) (IsDtypeKind_string \"integral\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_int64) (IsDtypeKind_string \"integral\")) (TRUE) :ruleset array_api_ruleset)\n(function DType_int32 () DType)\n(rewrite (isdtype (DType_int32) (IsDtypeKind_string \"integral\")) (TRUE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_float32) (IsDtypeKind_string \"real floating\")) (TRUE) :ruleset array_api_ruleset)\n(rewrite (isdtype %__expr_2565664028803046192 (IsDtypeKind_string \"real floating\")) (TRUE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_object) (IsDtypeKind_string \"real floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_int64) (IsDtypeKind_string \"real floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_int32) (IsDtypeKind_string \"real floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_float32) (IsDtypeKind_string \"complex floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype %__expr_2565664028803046192 (IsDtypeKind_string \"complex floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_object) (IsDtypeKind_string \"complex floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_int64) (IsDtypeKind_string \"complex floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_int32) (IsDtypeKind_string \"complex floating\")) (FALSE) :ruleset array_api_ruleset)\n(function IsDtypeKind_NULL () IsDtypeKind)\n(rewrite (isdtype d (IsDtypeKind_NULL)) (FALSE) :ruleset array_api_ruleset)\n(function IsDtypeKind_dtype (DType) IsDtypeKind)\n(rewrite (isdtype d (IsDtypeKind_dtype d)) (TRUE) :ruleset array_api_ruleset)\n(function IsDtypeKind___or__ (IsDtypeKind IsDtypeKind) IsDtypeKind :cost 10)\n(rewrite (isdtype d (IsDtypeKind___or__ k1 k2)) (Boolean___or__ (isdtype d k1) (isdtype d k2)) :ruleset array_api_ruleset)\n(rewrite (IsDtypeKind___or__ k1 (IsDtypeKind_NULL)) k1 :ruleset array_api_ruleset)\n(rewrite (DType___eq__ %__expr_2565664028803046192 %__expr_2565664028803046192) (TRUE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ %__expr_2565664028803046192 (DType_float32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ %__expr_2565664028803046192 (DType_int32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ %__expr_2565664028803046192 (DType_int64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ %__expr_2565664028803046192 (DType_object)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float32) %__expr_2565664028803046192) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float32) (DType_float32)) (TRUE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float32) (DType_int32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float32) (DType_int64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float32) (DType_object)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int32) %__expr_2565664028803046192) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int32) (DType_float32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int32) (DType_int32)) (TRUE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int32) (DType_int64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int32) (DType_object)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int64) %__expr_2565664028803046192) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int64) (DType_float32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int64) (DType_int32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int64) (DType_int64)) (TRUE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int64) (DType_object)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_object) %__expr_2565664028803046192) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_object) (DType_float32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_object) (DType_int32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_object) (DType_int64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_object) (DType_object)) (TRUE) :ruleset array_api_ruleset)\n(function idx_fn-UnstableFn_Int_Int_i-Int__unstable-app_idx_fn__Int___add___i__Int___init___1___ (UnstableFn_Int_Int Int) Int)\n(rewrite (idx_fn-UnstableFn_Int_Int_i-Int__unstable-app_idx_fn__Int___add___i__Int___init___1___ idx_fn i) (unstable-app idx_fn (Int___add__ i (Int___init__ 1))) :ruleset array_api_ruleset)\n(rewrite (TupleInt_length (TupleInt___init__ i idx_fn)) i :ruleset array_api_ruleset)\n(rewrite (TupleInt___getitem__ (TupleInt___init__ i idx_fn) i2) (unstable-app idx_fn i2) :ruleset array_api_ruleset)\n(rewrite (index_vec_int vs (Int___init__ k)) (vec-get vs k) :when ((> (vec-length vs) k)) :ruleset array_api_ruleset)\n(rewrite (TupleInt_fold (TupleInt___init__ (Int___init__ 0) idx_fn) i f) i :ruleset array_api_ruleset)\n(rewrite (TupleInt_fold (TupleInt___init__ (Int___init__ k) idx_fn) i f) (unstable-app f (TupleInt_fold (TupleInt___init__ (Int___init__ (- k 1)) (unstable-fn \"idx_fn-UnstableFn_Int_Int_i-Int__unstable-app_idx_fn__Int___add___i__Int___init___1___\" idx_fn)) i f) (unstable-app idx_fn (Int___init__ 0))) :when ((!= k 0)) :ruleset array_api_ruleset)\n(rewrite (TupleInt_fold_boolean (TupleInt___init__ (Int___init__ 0) idx_fn) b bool_f) b :ruleset array_api_ruleset)\n(rewrite (TupleInt_fold_boolean (TupleInt___init__ (Int___init__ k) idx_fn) b bool_f) (unstable-app bool_f (TupleInt_fold_boolean (TupleInt___init__ (Int___init__ (- k 1)) (unstable-fn \"idx_fn-UnstableFn_Int_Int_i-Int__unstable-app_idx_fn__Int___add___i__Int___init___1___\" idx_fn)) b bool_f) (unstable-app idx_fn (Int___init__ 0))) :when ((!= k 0)) :ruleset array_api_ruleset)\n(sort UnstableFn_Boolean_Int (UnstableFn (Int) Boolean))\n(function TupleInt_filter (TupleInt UnstableFn_Boolean_Int) TupleInt :cost 100)\n(rewrite (TupleInt_filter (TupleInt___init__ (Int___init__ 0) idx_fn) filter_f) (TupleInt___init__ (Int___init__ 0) idx_fn) :ruleset array_api_ruleset)\n(function TupleInt_if_ (Boolean TupleInt TupleInt) TupleInt)\n(rewrite (TupleInt_filter (TupleInt___init__ (Int___init__ k) idx_fn) filter_f) (TupleInt_if_ (unstable-app filter_f (unstable-app idx_fn (Int___init__ k))) (TupleInt___add__ (TupleInt_single (unstable-app idx_fn (Int___init__ k))) (TupleInt_filter (TupleInt___init__ (Int___init__ (- k 1)) (unstable-fn \"idx_fn-UnstableFn_Int_Int_i-Int__unstable-app_idx_fn__Int___add___i__Int___init___1___\" idx_fn)) filter_f)) (TupleInt_filter (TupleInt___init__ (Int___init__ (- k 1)) (unstable-fn \"idx_fn-UnstableFn_Int_Int_i-Int__unstable-app_idx_fn__Int___add___i__Int___init___1___\" idx_fn)) filter_f)) :when ((!= k 0)) :ruleset array_api_ruleset)\n(function bottom_indexing (Int) Int)\n(rewrite (TupleInt_EMPTY) (TupleInt___init__ (Int___init__ 0) (unstable-fn \"bottom_indexing\")) :ruleset array_api_ruleset)\n(rewrite (TupleInt_if_ (TRUE) ti ti2) ti :ruleset array_api_ruleset)\n(rewrite (TupleInt_if_ (FALSE) ti ti2) ti2 :ruleset array_api_ruleset)\n(rewrite (Float_abs (Float___init__ f)) (Float___init__ f) :when ((>= f 0.0)) :ruleset array_api_ruleset)\n(rewrite (Float_abs (Float___init__ f)) (Float___init__ (neg f)) :when ((< f 0.0)) :ruleset array_api_ruleset)\n(function Float_rational (Rational) Float :cost 2)\n(rewrite (Float___init__ f) (Float_rational (rational (to-i64 f) 1)) :when ((= (to-f64 (to-i64 f)) f)) :ruleset array_api_ruleset)\n(function Float_from_int (Int) Float)\n(rewrite (Float_from_int (Int___init__ i)) (Float_rational (rational i 1)) :ruleset array_api_ruleset)\n(function Float___add__ (Float Float) Float)\n(rewrite (Float___add__ (Float___init__ f) (Float___init__ f2)) (Float___init__ (+ f f2)) :ruleset array_api_ruleset)\n(function Float___sub__ (Float Float) Float)\n(rewrite (Float___sub__ (Float___init__ f) (Float___init__ f2)) (Float___init__ (- f f2)) :ruleset array_api_ruleset)\n(function Float___mul__ (Float Float) Float)\n(rewrite (Float___mul__ (Float___init__ f) (Float___init__ f2)) (Float___init__ (* f f2)) :ruleset array_api_ruleset)\n(function Float___truediv__ (Float Float) Float)\n(rewrite (Float___truediv__ (Float_rational r) (Float_rational r1)) (Float_rational (/ r r1)) :ruleset array_api_ruleset)\n(rewrite (Float___add__ (Float_rational r) (Float_rational r1)) (Float_rational (+ r r1)) :ruleset array_api_ruleset)\n(rewrite (Float___sub__ (Float_rational r) (Float_rational r1)) (Float_rational (- r r1)) :ruleset array_api_ruleset)\n(rewrite (Float___mul__ (Float_rational r) (Float_rational r1)) (Float_rational (* r r1)) :ruleset array_api_ruleset)\n(rewrite (Int___eq__ (Int___init__ i) (Int___init__ i)) (TRUE) :ruleset array_api_ruleset)\n(rule ((= r (Int___eq__ (Int___init__ i) (Int___init__ j)))\n (!= i j))\n ((union r (FALSE)))\n :ruleset array_api_ruleset )\n(function Int___ge__ (Int Int) Boolean)\n(rewrite (Int___ge__ (Int___init__ i) (Int___init__ i)) (TRUE) :ruleset array_api_ruleset)\n(rule ((= r (Int___ge__ (Int___init__ i) (Int___init__ j)))\n (> i j))\n ((union r (TRUE)))\n :ruleset array_api_ruleset )\n(rule ((= r (Int___ge__ (Int___init__ i) (Int___init__ j)))\n (< i j))\n ((union r (FALSE)))\n :ruleset array_api_ruleset )\n(rewrite (Int___lt__ (Int___init__ i) (Int___init__ i)) (FALSE) :ruleset array_api_ruleset)\n(rule ((= r (Int___lt__ (Int___init__ i) (Int___init__ j)))\n (< i j))\n ((union r (TRUE)))\n :ruleset array_api_ruleset )\n(rule ((= r (Int___lt__ (Int___init__ i) (Int___init__ j)))\n (> i j))\n ((union r (FALSE)))\n :ruleset array_api_ruleset )\n(function Int___gt__ (Int Int) Boolean)\n(rewrite (Int___gt__ (Int___init__ i) (Int___init__ i)) (FALSE) :ruleset array_api_ruleset)\n(rule ((= r (Int___gt__ (Int___init__ i) (Int___init__ j)))\n (> i j))\n ((union r (TRUE)))\n :ruleset array_api_ruleset )\n(rule ((= r (Int___gt__ (Int___init__ i) (Int___init__ j)))\n (< i j))\n ((union r (FALSE)))\n :ruleset array_api_ruleset )\n(function Int_i64 (Int) i64)\n(rule ((= o (Int___init__ j)))\n ((set (Int_i64 o) j))\n :ruleset array_api_ruleset )\n(rewrite (Int___add__ (Int___init__ i) (Int___init__ j)) (Int___init__ (+ i j)) :ruleset array_api_ruleset)\n(rewrite (Int___sub__ (Int___init__ i) (Int___init__ j)) (Int___init__ (- i j)) :ruleset array_api_ruleset)\n(rewrite (Int___mul__ (Int___init__ i) (Int___init__ j)) (Int___init__ (* i j)) :ruleset array_api_ruleset)\n(function Int___truediv__ (Int Int) Int)\n(rewrite (Int___truediv__ (Int___init__ i) (Int___init__ j)) (Int___init__ (/ i j)) :ruleset array_api_ruleset)\n(function Int___mod__ (Int Int) Int)\n(rewrite (Int___mod__ (Int___init__ i) (Int___init__ j)) (Int___init__ (% i j)) :ruleset array_api_ruleset)\n(function Int___and__ (Int Int) Int)\n(rewrite (Int___and__ (Int___init__ i) (Int___init__ j)) (Int___init__ (& i j)) :ruleset array_api_ruleset)\n(function Int___or__ (Int Int) Int)\n(rewrite (Int___or__ (Int___init__ i) (Int___init__ j)) (Int___init__ (| i j)) :ruleset array_api_ruleset)\n(function Int___xor__ (Int Int) Int)\n(rewrite (Int___xor__ (Int___init__ i) (Int___init__ j)) (Int___init__ (^ i j)) :ruleset array_api_ruleset)\n(function Int___lshift__ (Int Int) Int)\n(rewrite (Int___lshift__ (Int___init__ i) (Int___init__ j)) (Int___init__ (<< i j)) :ruleset array_api_ruleset)\n(function Int___rshift__ (Int Int) Int)\n(rewrite (Int___rshift__ (Int___init__ i) (Int___init__ j)) (Int___init__ (>> i j)) :ruleset array_api_ruleset)\n(function Int___invert__ (Int) Int)\n(rewrite (Int___invert__ (Int___init__ i)) (Int___init__ (not-i64 i)) :ruleset array_api_ruleset)\n(rewrite (Int_if_ (TRUE) o b) o :ruleset array_api_ruleset)\n(rewrite (Int_if_ (FALSE) o b) b :ruleset array_api_ruleset)\n(function Boolean_bool (Boolean) bool)\n(rule ((= x (TRUE)))\n ((set (Boolean_bool x) true))\n :ruleset array_api_ruleset )\n(rule ((= x (FALSE)))\n ((set (Boolean_bool x) false))\n :ruleset array_api_ruleset )\n(rewrite (Boolean___or__ (TRUE) x) (TRUE) :ruleset array_api_ruleset)\n(rewrite (Boolean___or__ (FALSE) x) x :ruleset array_api_ruleset)\n(function Boolean___and__ (Boolean Boolean) Boolean)\n(rewrite (Boolean___and__ (TRUE) x) x :ruleset array_api_ruleset)\n(rewrite (Boolean___and__ (FALSE) x) (FALSE) :ruleset array_api_ruleset)\n(function Boolean_if_int (Boolean Int Int) Int)\n(rewrite (Boolean_if_int (TRUE) i j) i :ruleset array_api_ruleset)\n(rewrite (Boolean_if_int (FALSE) i j) j :ruleset array_api_ruleset)\n(function Boolean___invert__ (Boolean) Boolean)\n(rewrite (Boolean___invert__ (TRUE)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (Boolean___invert__ (FALSE)) (TRUE) :ruleset array_api_ruleset)\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (DType___eq__ %__expr_2565664028803046192 (NDArray_dtype (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4)))))))) 0)\n(Int___eq__ (NDArray_ndim (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___eq__ (NDArray_ndim (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) 0)\n(Int___eq__ (NDArray_ndim (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___eq__ (NDArray_ndim (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1))) 0)\n(Int___ge__ (NDArray_ndim (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 3))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___ge__ (NDArray_ndim (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 3))) 0)\n(isdtype (NDArray_dtype (asarray (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (IsDtypeKind___or__ (IsDtypeKind_string \"real floating\") (IsDtypeKind___or__ (IsDtypeKind_string \"complex floating\") (IsDtypeKind_NULL))))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (isdtype (NDArray_dtype (asarray (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (IsDtypeKind___or__ (IsDtypeKind_string \"real floating\") (IsDtypeKind___or__ (IsDtypeKind_string \"complex floating\") (IsDtypeKind_NULL))))) 0)\n(let %__expr_-3674731718720096444 (OptionalDevice_none))\n(Value_to_bool (NDArray_to_value (isfinite (sum (asarray (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalIntOrTuple_none)))))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Value_to_bool (NDArray_to_value (isfinite (sum (asarray (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalIntOrTuple_none)))))) 0)\n(TupleInt_length (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (TupleInt_length (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) 0)\n(Int___lt__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (Int___init__ 2))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___lt__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (Int___init__ 2))) 0)\n(Int___eq__ (NDArray_ndim (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 2))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___eq__ (NDArray_ndim (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 2))) 0)\n(Int___lt__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (Int___init__ 1))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___lt__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (Int___init__ 1))) 0)\n(Int___ge__ (NDArray_ndim (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444)) (Int___init__ 3))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___ge__ (NDArray_ndim (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444)) (Int___init__ 3))) 0)\n(let %__expr_2305922367412063525 (Int___init__ 2))\n(Int___eq__ (NDArray_ndim (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444)) %__expr_2305922367412063525)\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___eq__ (NDArray_ndim (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444)) %__expr_2305922367412063525)) 0)\n(TupleInt_length (NDArray_shape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444)))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (TupleInt_length (NDArray_shape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444)))) 0)\n(let %__expr_2091604061025500396 (OptionalDType_none))\n(let %__expr_-4122594143565222517 (OptionalBool_none))\n(isdtype (NDArray_dtype (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) (IsDtypeKind___or__ (IsDtypeKind_string \"real floating\") (IsDtypeKind___or__ (IsDtypeKind_string \"complex floating\") (IsDtypeKind_NULL))))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (isdtype (NDArray_dtype (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) (IsDtypeKind___or__ (IsDtypeKind_string \"real floating\") (IsDtypeKind___or__ (IsDtypeKind_string \"complex floating\") (IsDtypeKind_NULL))))) 0)\n(TupleInt_length (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (TupleInt_length (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) 0)\n(TupleInt_length (NDArray_shape (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (TupleInt_length (NDArray_shape (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)))) 0)\n(let %__expr_-7942988945600443502 (Int___init__ 0))\n(Int___lt__ (TupleInt___getitem__ (NDArray_shape (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_-7942988945600443502) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___lt__ (TupleInt___getitem__ (NDArray_shape (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_-7942988945600443502) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)))) 0)\n(let %__expr_-3520630818915629594 (Int___init__ 150))\n(Int___gt__ (TupleInt___getitem__ (NDArray_shape (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_-7942988945600443502) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___gt__ (TupleInt___getitem__ (NDArray_shape (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_-7942988945600443502) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)))) 0)\n(Int___eq__ (TupleInt___getitem__ (NDArray_shape (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_-7942988945600443502) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___eq__ (TupleInt___getitem__ (NDArray_shape (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_-7942988945600443502) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)))) 0)\n(TupleInt_length (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (TupleInt_length (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) 0)\n(Int___eq__ (NDArray_ndim (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_2305922367412063525)\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___eq__ (NDArray_ndim (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_2305922367412063525)) 0)\n(let %__expr_3300329792522185471 (Int___init__ 1))\n(Int___eq__ (NDArray_ndim (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_3300329792522185471)\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___eq__ (NDArray_ndim (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_3300329792522185471)) 0)\n(TupleInt_length (NDArray_shape (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (TupleInt_length (NDArray_shape (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)))) 0)\n(TupleInt___getitem__ (NDArray_shape (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_-7942988945600443502)\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (TupleInt___getitem__ (NDArray_shape (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_-7942988945600443502)) 0)\n(DType___eq__ (NDArray_dtype (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) (DType_object))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (DType___eq__ (NDArray_dtype (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) (DType_object))) 0)\n(Int___eq__ (NDArray_ndim (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_2305922367412063525)\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___eq__ (NDArray_ndim (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_2305922367412063525)) 0)\n(isdtype (NDArray_dtype (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) (IsDtypeKind_string \"real floating\"))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (isdtype (NDArray_dtype (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) (IsDtypeKind_string \"real floating\"))) 0)\n(Int___gt__ (TupleInt___getitem__ (NDArray_shape (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) %__expr_-7942988945600443502) %__expr_2305922367412063525)\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___gt__ (TupleInt___getitem__ (NDArray_shape (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) %__expr_-7942988945600443502) %__expr_2305922367412063525)) 0)\n(TupleInt_length (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (TupleInt_length (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) 0)\n(Int___eq__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))) %__expr_-7942988945600443502))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___eq__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))) %__expr_-7942988945600443502))) 0)\n(TupleNDArray_length (unique_counts (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (TupleNDArray_length (unique_counts (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)))) 0)\n(TupleInt___getitem__ (NDArray_shape (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_-7942988945600443502)\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (TupleInt___getitem__ (NDArray_shape (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_-7942988945600443502)) 0)\n(let %__expr_478758938070675600 (Value_int (Int___init__ 0)))\n(Value_to_bool (NDArray_to_value (any (NDArray___lt__ (NDArray___truediv__ (astype (TupleNDArray___getitem__ (unique_counts (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_3300329792522185471) (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (NDArray_scalar (Value_float (Float___init__ 150.0)))) (NDArray_scalar %__expr_478758938070675600)))))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Value_to_bool (NDArray_to_value (any (NDArray___lt__ (NDArray___truediv__ (astype (TupleNDArray___getitem__ (unique_counts (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_3300329792522185471) (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (NDArray_scalar (Value_float (Float___init__ 150.0)))) (NDArray_scalar %__expr_478758938070675600)))))) 0)\n(Value_to_bool (NDArray_to_value (NDArray___gt__ (ndarray-abs (NDArray___sub__ (sum (NDArray___truediv__ (astype (TupleNDArray___getitem__ (unique_counts (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_3300329792522185471) (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (NDArray_scalar (Value_float (Float___init__ 150.0)))) (OptionalIntOrTuple_none)) (NDArray_scalar (Value_float (Float___init__ 1.0))))) (NDArray_scalar (Value_float (Float___init__ 0.00001))))))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Value_to_bool (NDArray_to_value (NDArray___gt__ (ndarray-abs (NDArray___sub__ (sum (NDArray___truediv__ (astype (TupleNDArray___getitem__ (unique_counts (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_3300329792522185471) (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (NDArray_scalar (Value_float (Float___init__ 150.0)))) (OptionalIntOrTuple_none)) (NDArray_scalar (Value_float (Float___init__ 1.0))))) (NDArray_scalar (Value_float (Float___init__ 0.00001))))))) 0)\n(Int___lt__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (Int___sub__ (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))) %__expr_-7942988945600443502) %__expr_3300329792522185471))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___lt__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (Int___sub__ (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))) %__expr_-7942988945600443502) %__expr_3300329792522185471))) 0)\n(Int___lt__ (Int___sub__ (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))) %__expr_-7942988945600443502) %__expr_3300329792522185471) %__expr_2305922367412063525)\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___lt__ (Int___sub__ (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))) %__expr_-7942988945600443502) %__expr_3300329792522185471) %__expr_2305922367412063525)) 0)\n(TupleInt_length (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (TupleInt_length (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) 0)\n(TupleNDArray_length (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (TupleNDArray_length (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)))) 0)\n(TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_-7942988945600443502)) %__expr_-7942988945600443502)\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_-7942988945600443502)) %__expr_-7942988945600443502)) 0)\n(NDArray_size (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none))))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (NDArray_size (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none))))) 0)\n(let %__expr_-8664633617851008504 (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)))\n(let %__expr_-8475266842302933511 (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))\n(let %__expr_-6765600943420531488 (Value_int (Int___init__ 2)))\n(let %__expr_-5200143055942215294 (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))\n(let %__expr_-8613124149453883591 (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))\n(let %__expr_-622493510873225930 (Value_int (Int___init__ 1)))\n(let %__expr_-3283806677371465170 (NDArray_scalar %__expr_478758938070675600))\n(let %__expr_-2704792733181451377 (TupleNDArray___getitem__ %__expr_-8664633617851008504 %__expr_3300329792522185471))\n(sort MultiAxisIndexKeyItem)\n(sort Slice)\n(function MultiAxisIndexKeyItem_slice (Slice) MultiAxisIndexKeyItem)\n(function Slice___init__ (OptionalInt OptionalInt OptionalInt) Slice)\n(let %__expr_-8637348939342624324 (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))\n(sort IntOrTuple)\n(function OptionalIntOrTuple_some (IntOrTuple) OptionalIntOrTuple)\n(function IntOrTuple_int (Int) IntOrTuple)\n(let %__expr_1913846200346632608 (OptionalIntOrTuple_some (IntOrTuple_int %__expr_-7942988945600443502)))\n(let %__expr_6185990579165616281 (FALSE))\n(let %__expr_-1113027338580586528 (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none))))\n(sort MultiAxisIndexKey)\n(function IndexKey_multi_axis (MultiAxisIndexKey) IndexKey)\n(sort Vec_MultiAxisIndexKeyItem (Vec MultiAxisIndexKeyItem))\n(function MultiAxisIndexKey_from_vec (Vec_MultiAxisIndexKeyItem) MultiAxisIndexKey)\n(function MultiAxisIndexKeyItem_int (Int) MultiAxisIndexKeyItem)\n(let %__expr_7180621784385959982 (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int %__expr_3300329792522185471) %__expr_-8637348939342624324))))\n(let %__expr_-4323225966908438009 (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int %__expr_-7942988945600443502) %__expr_-8637348939342624324))))\n(let %__expr_483064111004974365 (Float___init__ 1.0))\n(let %__expr_-143818766793636568 (OptionalInt_none))\n(function NDArray___setitem__ (NDArray IndexKey NDArray) NDArray)\n(function zeros (TupleInt OptionalDType OptionalDevice) NDArray)\n(function OptionalDType_some (DType) OptionalDType)\n(sort Device)\n(function OptionalDevice_some (Device) OptionalDevice)\n(function NDArray_device (NDArray) Device)\n(function mean (NDArray OptionalIntOrTuple Boolean) NDArray)\n(function IndexKey_ndarray (NDArray) IndexKey)\n(function NDArray___eq__ (NDArray NDArray) NDArray)\n(let %__expr_7843526591494960327 (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_-7942988945600443502)) %__expr_-7942988945600443502) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device %__expr_-8613124149453883591))) %__expr_-4323225966908438009 (mean (NDArray___getitem__ %__expr_-8613124149453883591 (IndexKey_ndarray (NDArray___eq__ %__expr_-2704792733181451377 %__expr_-3283806677371465170))) %__expr_1913846200346632608 %__expr_6185990579165616281)) %__expr_7180621784385959982 (mean (NDArray___getitem__ %__expr_-8613124149453883591 (IndexKey_ndarray (NDArray___eq__ %__expr_-2704792733181451377 (NDArray_scalar %__expr_-622493510873225930)))) %__expr_1913846200346632608 %__expr_6185990579165616281)) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int %__expr_2305922367412063525) %__expr_-8637348939342624324))) (mean (NDArray___getitem__ %__expr_-8613124149453883591 (IndexKey_ndarray (NDArray___eq__ %__expr_-2704792733181451377 (NDArray_scalar %__expr_-6765600943420531488)))) %__expr_1913846200346632608 %__expr_6185990579165616281)))\n(let %__expr_-954298076671303615 (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int %__expr_2305922367412063525) %__expr_-8637348939342624324))))\n(function std (NDArray OptionalIntOrTuple) NDArray)\n(function OptionalInt_some (Int) OptionalInt)\n(let %__expr_3049932803880609425 (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ %__expr_-8613124149453883591 (IndexKey_ndarray (NDArray___eq__ %__expr_-5200143055942215294 (NDArray___getitem__ %__expr_-1113027338580586528 (IndexKey_int %__expr_-7942988945600443502))))) (NDArray___getitem__ %__expr_7843526591494960327 %__expr_-4323225966908438009))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ %__expr_-8613124149453883591 (IndexKey_ndarray (NDArray___eq__ %__expr_-5200143055942215294 (NDArray___getitem__ %__expr_-1113027338580586528 (IndexKey_int %__expr_3300329792522185471))))) (NDArray___getitem__ %__expr_7843526591494960327 %__expr_7180621784385959982))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ %__expr_-8613124149453883591 (IndexKey_ndarray (NDArray___eq__ %__expr_-5200143055942215294 (NDArray___getitem__ %__expr_-1113027338580586528 (IndexKey_int %__expr_2305922367412063525))))) (NDArray___getitem__ %__expr_7843526591494960327 %__expr_-954298076671303615))))) (OptionalInt_some %__expr_-7942988945600443502)) %__expr_1913846200346632608))\n(let %__expr_-671931098406187877 (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ %__expr_-8613124149453883591 (IndexKey_ndarray (NDArray___eq__ %__expr_-5200143055942215294 (NDArray___getitem__ %__expr_-1113027338580586528 (IndexKey_int %__expr_-7942988945600443502))))) (NDArray___getitem__ %__expr_7843526591494960327 %__expr_-4323225966908438009))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ %__expr_-8613124149453883591 (IndexKey_ndarray (NDArray___eq__ %__expr_-5200143055942215294 (NDArray___getitem__ %__expr_-1113027338580586528 (IndexKey_int %__expr_3300329792522185471))))) (NDArray___getitem__ %__expr_7843526591494960327 %__expr_7180621784385959982))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ %__expr_-8613124149453883591 (IndexKey_ndarray (NDArray___eq__ %__expr_-5200143055942215294 (NDArray___getitem__ %__expr_-1113027338580586528 (IndexKey_int %__expr_2305922367412063525))))) (NDArray___getitem__ %__expr_7843526591494960327 %__expr_-954298076671303615))))) (OptionalInt_some %__expr_-7942988945600443502)))\n(function NDArray___mul__ (NDArray NDArray) NDArray)\n(function ndarray-sqrt (NDArray) NDArray)\n(TupleNDArray_length (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ %__expr_483064111004974365 (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))) %__expr_-7942988945600443502)))))) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) (NDArray___truediv__ %__expr_-671931098406187877 (NDArray___setitem__ %__expr_3049932803880609425 (IndexKey_ndarray (NDArray___eq__ %__expr_3049932803880609425 %__expr_-3283806677371465170)) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) %__expr_6185990579165616281))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (TupleNDArray_length (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ %__expr_483064111004974365 (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))) %__expr_-7942988945600443502)))))) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) (NDArray___truediv__ %__expr_-671931098406187877 (NDArray___setitem__ %__expr_3049932803880609425 (IndexKey_ndarray (NDArray___eq__ %__expr_3049932803880609425 %__expr_-3283806677371465170)) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) %__expr_6185990579165616281))) 0)\n(Int___eq__ (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))) %__expr_-7942988945600443502) %__expr_3300329792522185471)\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___eq__ (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))) %__expr_-7942988945600443502) %__expr_3300329792522185471)) 0)\n(let %__expr_-1459297673498492435 (Slice___init__ %__expr_-143818766793636568 (OptionalInt_some (Value_to_int (NDArray_to_value (sum (astype (NDArray___gt__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ %__expr_483064111004974365 (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))) %__expr_-7942988945600443502)))))) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) (NDArray___truediv__ %__expr_-671931098406187877 (NDArray___setitem__ %__expr_3049932803880609425 (IndexKey_ndarray (NDArray___eq__ %__expr_3049932803880609425 %__expr_-3283806677371465170)) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) %__expr_6185990579165616281) %__expr_3300329792522185471) (NDArray_scalar (Value_float (Float___init__ 0.0001)))) (DType_int32)) (OptionalIntOrTuple_none))))) %__expr_-143818766793636568))\n(let %__expr_-5540247018246576406 (NDArray___truediv__ (astype (TupleNDArray___getitem__ (unique_counts (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_3300329792522185471) (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (NDArray_scalar (Value_float (Float___init__ 150.0)))))\n(let %__expr_-4744074158064860754 (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ %__expr_483064111004974365 (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))) %__expr_-7942988945600443502)))))) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) (NDArray___truediv__ %__expr_-671931098406187877 (NDArray___setitem__ %__expr_3049932803880609425 (IndexKey_ndarray (NDArray___eq__ %__expr_3049932803880609425 %__expr_-3283806677371465170)) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) %__expr_6185990579165616281) %__expr_3300329792522185471))\n(let %__expr_2307122782736907488 (NDArray___setitem__ %__expr_3049932803880609425 (IndexKey_ndarray (NDArray___eq__ %__expr_3049932803880609425 %__expr_-3283806677371465170)) (NDArray_scalar (Value_float (Float___init__ 1.0)))))\n(let %__expr_4799320818084596281 (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ %__expr_483064111004974365 (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))) %__expr_-7942988945600443502)))))) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) (NDArray___truediv__ %__expr_-671931098406187877 (NDArray___setitem__ %__expr_3049932803880609425 (IndexKey_ndarray (NDArray___eq__ %__expr_3049932803880609425 %__expr_-3283806677371465170)) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) %__expr_6185990579165616281))\n(function NDArray___matmul__ (NDArray NDArray) NDArray)\n(function IndexKey_slice (Slice) IndexKey)\n(TupleNDArray_length (svd (NDArray___matmul__ (NDArray_T (NDArray___mul__ (ndarray-sqrt (NDArray___mul__ (NDArray___mul__ (NDArray_scalar (Value_int (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)))) %__expr_-5540247018246576406) (NDArray_scalar (Value_float (Float___truediv__ %__expr_483064111004974365 (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))) %__expr_-7942988945600443502) %__expr_3300329792522185471))))))) (NDArray_T (NDArray___sub__ %__expr_7843526591494960327 (NDArray___matmul__ %__expr_-5540247018246576406 %__expr_7843526591494960327))))) (NDArray___truediv__ (NDArray_T (NDArray___truediv__ (NDArray___getitem__ (TupleNDArray___getitem__ %__expr_4799320818084596281 %__expr_2305922367412063525) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_slice %__expr_-1459297673498492435) %__expr_-8637348939342624324)))) %__expr_2307122782736907488)) (NDArray___getitem__ %__expr_-4744074158064860754 (IndexKey_slice %__expr_-1459297673498492435)))) %__expr_6185990579165616281))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (TupleNDArray_length (svd (NDArray___matmul__ (NDArray_T (NDArray___mul__ (ndarray-sqrt (NDArray___mul__ (NDArray___mul__ (NDArray_scalar (Value_int (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)))) %__expr_-5540247018246576406) (NDArray_scalar (Value_float (Float___truediv__ %__expr_483064111004974365 (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))) %__expr_-7942988945600443502) %__expr_3300329792522185471))))))) (NDArray_T (NDArray___sub__ %__expr_7843526591494960327 (NDArray___matmul__ %__expr_-5540247018246576406 %__expr_7843526591494960327))))) (NDArray___truediv__ (NDArray_T (NDArray___truediv__ (NDArray___getitem__ (TupleNDArray___getitem__ %__expr_4799320818084596281 %__expr_2305922367412063525) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_slice %__expr_-1459297673498492435) %__expr_-8637348939342624324)))) %__expr_2307122782736907488)) (NDArray___getitem__ %__expr_-4744074158064860754 (IndexKey_slice %__expr_-1459297673498492435)))) %__expr_6185990579165616281))) 0)\n(TupleInt_length (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (TupleInt_length (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))))) 0)\n(Int___eq__ (Int___mul__ %__expr_3300329792522185471 (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))) %__expr_-7942988945600443502)) %__expr_2305922367412063525)\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___eq__ (Int___mul__ %__expr_3300329792522185471 (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))) %__expr_-7942988945600443502)) %__expr_2305922367412063525)) 0)\n(Int___eq__ (NDArray_ndim (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___eq__ (NDArray_ndim (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) 0)\n(Int___eq__ (NDArray_ndim (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___eq__ (NDArray_ndim (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1))) 0)\n(Int___ge__ (NDArray_ndim (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 3))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___ge__ (NDArray_ndim (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 3))) 0)\n(isdtype (NDArray_dtype (asarray (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (IsDtypeKind___or__ (IsDtypeKind_string \"real floating\") (IsDtypeKind___or__ (IsDtypeKind_string \"complex floating\") (IsDtypeKind_NULL))))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (isdtype (NDArray_dtype (asarray (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (IsDtypeKind___or__ (IsDtypeKind_string \"real floating\") (IsDtypeKind___or__ (IsDtypeKind_string \"complex floating\") (IsDtypeKind_NULL))))) 0)\n(Value_to_bool (NDArray_to_value (isfinite (sum (asarray (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalIntOrTuple_none)))))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Value_to_bool (NDArray_to_value (isfinite (sum (asarray (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalIntOrTuple_none)))))) 0)\n(TupleInt_length (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (TupleInt_length (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) 0)\n(Int___lt__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) %__expr_3300329792522185471)\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___lt__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) %__expr_3300329792522185471)) 0)\n(Int___eq__ (NDArray_ndim (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 2))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___eq__ (NDArray_ndim (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 2))) 0)\n(Int___lt__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (Int___init__ 1))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___lt__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (Int___init__ 1))) 0)\n(TupleInt_length (NDArray_shape (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4)))))))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Int_i64 (TupleInt_length (NDArray_shape (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4)))))))) 0)\n(let %__expr_-7766708656681124433 (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))))\n(Int___eq__ (TupleInt___getitem__ (NDArray_shape (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4)))))) %__expr_3300329792522185471) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))\n(run-schedule (saturate (run array_api_ruleset)))\n(extract (Boolean_bool (Int___eq__ (TupleInt___getitem__ (NDArray_shape (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4)))))) %__expr_3300329792522185471) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") %__expr_2565664028803046192) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) 0)\n(pop 1)\n(ruleset array_api_ruleset)\n(sort Int)\n(function i-Int__-Int_i (Int Int) Int)\n(rewrite (i-Int__-Int_i i _) i :ruleset array_api_ruleset)\n(sort TupleInt)\n(function TupleInt_single (Int) TupleInt)\n(sort UnstableFn_Int_Int (UnstableFn (Int) Int))\n(function TupleInt___init__ (Int UnstableFn_Int_Int) TupleInt :unextractable)\n(function Int___init__ (i64) Int)\n(rewrite (TupleInt_single i) (TupleInt___init__ (Int___init__ 1) (unstable-fn \"i-Int__-Int_i\" i)) :ruleset array_api_ruleset)\n(function i-Int_i (Int) Int)\n(rewrite (i-Int_i i) i :ruleset array_api_ruleset)\n(function TupleInt_range (Int) TupleInt)\n(rewrite (TupleInt_range stop) (TupleInt___init__ stop (unstable-fn \"i-Int_i\")) :ruleset array_api_ruleset)\n(sort Vec_Int (Vec Int))\n(function TupleInt_from_vec (Vec_Int) TupleInt)\n(function index_vec_int (Vec_Int Int) Int)\n(rewrite (TupleInt_from_vec vec) (TupleInt___init__ (Int___init__ (vec-length vec)) (unstable-fn \"index_vec_int\" vec)) :ruleset array_api_ruleset)\n(sort Boolean)\n(function Int_if_ (Boolean Int Int) Int)\n(function Int___lt__ (Int Int) Boolean)\n(function TupleInt_length (TupleInt) Int)\n(function TupleInt___getitem__ (TupleInt Int) Int)\n(function Int___sub__ (Int Int) Int)\n(function other-TupleInt_self-TupleInt_i-Int__Int_if___Int___lt___i__TupleInt_length_self____TupleInt___getitem___self_i___TupleInt___getitem___other__Int___sub___i__TupleInt_length_self____ (TupleInt TupleInt Int) Int)\n(rewrite (other-TupleInt_self-TupleInt_i-Int__Int_if___Int___lt___i__TupleInt_length_self____TupleInt___getitem___self_i___TupleInt___getitem___other__Int___sub___i__TupleInt_length_self____ other self i) (Int_if_ (Int___lt__ i (TupleInt_length self)) (TupleInt___getitem__ self i) (TupleInt___getitem__ other (Int___sub__ i (TupleInt_length self)))) :ruleset array_api_ruleset)\n(function TupleInt___add__ (TupleInt TupleInt) TupleInt)\n(function Int___add__ (Int Int) Int)\n(rewrite (TupleInt___add__ self other) (TupleInt___init__ (Int___add__ (TupleInt_length self) (TupleInt_length other)) (unstable-fn \"other-TupleInt_self-TupleInt_i-Int__Int_if___Int___lt___i__TupleInt_length_self____TupleInt___getitem___self_i___TupleInt___getitem___other__Int___sub___i__TupleInt_length_self____\" other self)) :ruleset array_api_ruleset)\n(function Boolean___or__ (Boolean Boolean) Boolean)\n(function Int___eq__ (Int Int) Boolean)\n(function i-Int_acc-Boolean_j-Int__Boolean___or___acc__Int___eq___i_j__ (Int Boolean Int) Boolean)\n(rewrite (i-Int_acc-Boolean_j-Int__Boolean___or___acc__Int___eq___i_j__ i acc j) (Boolean___or__ acc (Int___eq__ i j)) :ruleset array_api_ruleset)\n(function TupleInt_contains (TupleInt Int) Boolean)\n(sort UnstableFn_Boolean_Boolean_Int (UnstableFn (Boolean Int) Boolean))\n(function TupleInt_fold_boolean (TupleInt Boolean UnstableFn_Boolean_Boolean_Int) Boolean)\n(function FALSE () Boolean)\n(rewrite (TupleInt_contains self i) (TupleInt_fold_boolean self (FALSE) (unstable-fn \"i-Int_acc-Boolean_j-Int__Boolean___or___acc__Int___eq___i_j__\" i)) :ruleset array_api_ruleset)\n(function f-UnstableFn_Int_Int_self-TupleInt_i-Int__unstable-app_f__TupleInt___getitem___self_i__ (UnstableFn_Int_Int TupleInt Int) Int)\n(rewrite (f-UnstableFn_Int_Int_self-TupleInt_i-Int__unstable-app_f__TupleInt___getitem___self_i__ f self i) (unstable-app f (TupleInt___getitem__ self i)) :ruleset array_api_ruleset)\n(function TupleInt_map (TupleInt UnstableFn_Int_Int) TupleInt :cost 100)\n(rewrite (TupleInt_map self f) (TupleInt___init__ (TupleInt_length self) (unstable-fn \"f-UnstableFn_Int_Int_self-TupleInt_i-Int__unstable-app_f__TupleInt___getitem___self_i__\" f self)) :ruleset array_api_ruleset)\n(sort NDArray)\n(function NDArray_size (NDArray) Int)\n(sort UnstableFn_Int_Int_Int (UnstableFn (Int Int) Int))\n(function TupleInt_fold (TupleInt Int UnstableFn_Int_Int_Int) Int)\n(function NDArray_shape (NDArray) TupleInt)\n(function Int___mul__ (Int Int) Int)\n(rewrite (NDArray_size x) (TupleInt_fold (NDArray_shape x) (Int___init__ 1) (unstable-fn \"Int___mul__\")) :ruleset array_api_ruleset)\n(function unique_values (NDArray) NDArray)\n(sort TupleValue)\n(function NDArray_vector (TupleValue) NDArray)\n(sort Value)\n(function possible_values (Value) TupleValue)\n(function NDArray_index (NDArray TupleInt) Value)\n(function ALL_INDICES () TupleInt)\n(rewrite (unique_values a) (NDArray_vector (possible_values (NDArray_index a (ALL_INDICES)))) :ruleset array_api_ruleset)\n(function Value_isfinite (Value) Boolean)\n(function Value_int (Int) Value)\n(function TRUE () Boolean)\n(rewrite (Value_isfinite (Value_int i)) (TRUE) :ruleset array_api_ruleset)\n(function Value_bool (Boolean) Value)\n(rewrite (Value_isfinite (Value_bool b)) (TRUE) :ruleset array_api_ruleset)\n(sort Float)\n(function Value_float (Float) Value)\n(function Float___init__ (f64) Float :cost 3)\n(rewrite (Value_isfinite (Value_float (Float___init__ f))) (TRUE) :when ((!= f NaN)) :ruleset array_api_ruleset)\n(function isfinite (NDArray) NDArray)\n(sort OptionalIntOrTuple)\n(function sum (NDArray OptionalIntOrTuple) NDArray)\n(function OptionalIntOrTuple_none () OptionalIntOrTuple)\n(function NDArray_scalar (Value) NDArray)\n(rewrite (isfinite (sum arr (OptionalIntOrTuple_none))) (NDArray_scalar (Value_bool (Value_isfinite (NDArray_index arr (ALL_INDICES))))) :ruleset array_api_ruleset)\n(function assume_value_one_of (NDArray TupleValue) NDArray)\n(rewrite (NDArray_shape (assume_value_one_of x vs)) (NDArray_shape x) :ruleset array_api_ruleset)\n(sort DType)\n(function NDArray_dtype (NDArray) DType)\n(rewrite (NDArray_dtype (assume_value_one_of x vs)) (NDArray_dtype x) :ruleset array_api_ruleset)\n(rule ((= v (NDArray_index (assume_value_one_of x vs) idx)))\n ((union v (NDArray_index x idx))\n (union (possible_values v) vs))\n :ruleset array_api_ruleset )\n(function assume_isfinite (NDArray) NDArray)\n(rewrite (NDArray_shape (assume_isfinite x)) (NDArray_shape x) :ruleset array_api_ruleset)\n(rewrite (NDArray_dtype (assume_isfinite x)) (NDArray_dtype x) :ruleset array_api_ruleset)\n(rewrite (NDArray_index (assume_isfinite x) ti) (NDArray_index x ti) :ruleset array_api_ruleset)\n(rewrite (Value_isfinite (NDArray_index (assume_isfinite x) ti)) (TRUE) :ruleset array_api_ruleset)\n(function assume_shape (NDArray TupleInt) NDArray)\n(rewrite (NDArray_shape (assume_shape x shape)) shape :ruleset array_api_ruleset)\n(rewrite (NDArray_dtype (assume_shape x shape)) (NDArray_dtype x) :ruleset array_api_ruleset)\n(rewrite (NDArray_index (assume_shape x shape) idx) (NDArray_index x idx) :ruleset array_api_ruleset)\n(function assume_dtype (NDArray DType) NDArray)\n(rewrite (NDArray_dtype (assume_dtype x dtype)) dtype :ruleset array_api_ruleset)\n(rewrite (NDArray_shape (assume_dtype x dtype)) (NDArray_shape x) :ruleset array_api_ruleset)\n(rewrite (NDArray_index (assume_dtype x dtype) idx) (NDArray_index x idx) :ruleset array_api_ruleset)\n(sort IndexKey)\n(function NDArray___getitem__ (NDArray IndexKey) NDArray)\n(function IndexKey_int (Int) IndexKey)\n(rewrite (NDArray___getitem__ x (IndexKey_int i)) (NDArray_scalar (NDArray_index x (TupleInt_single i))) :ruleset array_api_ruleset)\n(sort OptionalBool)\n(function reshape (NDArray TupleInt OptionalBool) NDArray)\n(rule ((= __a (reshape x shape copy)))\n ((NDArray_shape x)\n (TupleInt_length (NDArray_shape x)))\n :ruleset array_api_ruleset )\n(rule ((reshape x shape copy))\n ((TupleInt_length shape)\n (TupleInt___getitem__ shape (Int___init__ 0)))\n :ruleset array_api_ruleset )\n(rewrite (reshape x shape copy) x :when ((= (TupleInt_length (NDArray_shape x)) (Int___init__ 1)) (= (TupleInt_length shape) (Int___init__ 1)) (= (TupleInt___getitem__ shape (Int___init__ 0)) (Int___init__ -1))) :ruleset array_api_ruleset)\n(function TupleValue_length (TupleValue) Int)\n(rewrite (NDArray_shape (NDArray_vector vs)) (TupleInt_single (TupleValue_length vs)) :ruleset array_api_ruleset)\n(function Value_dtype (Value) DType)\n(function TupleValue___getitem__ (TupleValue Int) Value)\n(rewrite (NDArray_dtype (NDArray_vector vs)) (Value_dtype (TupleValue___getitem__ vs (Int___init__ 0))) :ruleset array_api_ruleset)\n(rewrite (NDArray_index (NDArray_vector vs) ti) (TupleValue___getitem__ vs (TupleInt___getitem__ ti (Int___init__ 0))) :ruleset array_api_ruleset)\n(function TupleInt_EMPTY () TupleInt)\n(rewrite (NDArray_shape (NDArray_scalar v)) (TupleInt_EMPTY) :ruleset array_api_ruleset)\n(rewrite (NDArray_dtype (NDArray_scalar v)) (Value_dtype v) :ruleset array_api_ruleset)\n(rewrite (NDArray_index (NDArray_scalar v) (TupleInt_EMPTY)) v :ruleset array_api_ruleset)\n(function any (NDArray) NDArray)\n(function TupleValue_includes (TupleValue Value) Boolean)\n(function Value_to_truthy_value (Value) Value)\n(rewrite (any x) (NDArray_scalar (Value_bool (TupleValue_includes (possible_values (Value_to_truthy_value (NDArray_index x (ALL_INDICES)))) (Value_bool (TRUE))))) :ruleset array_api_ruleset)\n(function NDArray___lt__ (NDArray NDArray) NDArray)\n(function Value___lt__ (Value Value) Value)\n(function broadcast_index (TupleInt TupleInt TupleInt) TupleInt)\n(function broadcast_shapes (TupleInt TupleInt) TupleInt)\n(rewrite (NDArray_index (NDArray___lt__ x y) idx) (Value___lt__ (NDArray_index x (broadcast_index (NDArray_shape x) (broadcast_shapes (NDArray_shape x) (NDArray_shape y)) idx)) (NDArray_index y (broadcast_index (NDArray_shape y) (broadcast_shapes (NDArray_shape x) (NDArray_shape y)) idx))) :ruleset array_api_ruleset)\n(function NDArray___truediv__ (NDArray NDArray) NDArray)\n(function Value___truediv__ (Value Value) Value)\n(rewrite (NDArray_index (NDArray___truediv__ x y) idx) (Value___truediv__ (NDArray_index x (broadcast_index (NDArray_shape x) (broadcast_shapes (NDArray_shape x) (NDArray_shape y)) idx)) (NDArray_index y (broadcast_index (NDArray_shape y) (broadcast_shapes (NDArray_shape x) (NDArray_shape y)) idx))) :ruleset array_api_ruleset)\n(rewrite (NDArray_index (NDArray_scalar v) idx) v :ruleset array_api_ruleset)\n(function astype (NDArray DType) NDArray)\n(function Value_astype (Value DType) Value)\n(rewrite (NDArray_index (astype x dtype) idx) (Value_astype (NDArray_index x idx) dtype) :ruleset array_api_ruleset)\n(relation greater_zero (Value))\n(sort TupleNDArray)\n(function TupleNDArray___getitem__ (TupleNDArray Int) NDArray)\n(function unique_counts (NDArray) TupleNDArray)\n(rule ((= v (NDArray_index (TupleNDArray___getitem__ (unique_counts x) (Int___init__ 1)) idx)))\n ((greater_zero v))\n :ruleset array_api_ruleset )\n(rule ((greater_zero v)\n (= v1 (Value_astype v dtype)))\n ((greater_zero v1))\n :ruleset array_api_ruleset )\n(rule ((= v (Value_float (Float___init__ f)))\n (> f 0.0))\n ((greater_zero v))\n :ruleset array_api_ruleset )\n(rule ((= v (Value_int (Int___init__ i)))\n (> i 0))\n ((greater_zero v))\n :ruleset array_api_ruleset )\n(rule ((greater_zero v)\n (greater_zero v1)\n (= v2 (Value___truediv__ v v1)))\n ((greater_zero v2))\n :ruleset array_api_ruleset )\n(rule ((greater_zero v)\n (= v1 (Value___lt__ v (Value_int (Int___init__ 0)))))\n ((union v1 (Value_bool (FALSE))))\n :ruleset array_api_ruleset )\n(function TupleValue___init__ (Value) TupleValue)\n(rewrite (possible_values (Value_bool b)) (TupleValue___init__ (Value_bool b)) :ruleset array_api_ruleset)\n(rule ((= v1 (Value_astype v dtype))\n (greater_zero v))\n ((greater_zero v1))\n :ruleset array_api_ruleset )\n(function TupleNDArray_length (TupleNDArray) Int)\n(function svd (NDArray Boolean) TupleNDArray)\n(rewrite (TupleNDArray_length (svd x full_matrices)) (Int___init__ 3) :ruleset array_api_ruleset)\n(function unique_inverse (NDArray) TupleNDArray)\n(rewrite (TupleNDArray_length (unique_inverse x)) (Int___init__ 2) :ruleset array_api_ruleset)\n(rewrite (TupleNDArray___getitem__ (unique_inverse x) (Int___init__ 0)) (unique_values x) :ruleset array_api_ruleset)\n(function ndarray-abs (NDArray) NDArray)\n(function Float_abs (Float) Float)\n(rewrite (ndarray-abs (NDArray_scalar (Value_float f))) (NDArray_scalar (Value_float (Float_abs f))) :ruleset array_api_ruleset)\n(rewrite (TupleNDArray_length (unique_counts x)) (Int___init__ 2) :ruleset array_api_ruleset)\n(rewrite (sum (TupleNDArray___getitem__ (unique_counts x) (Int___init__ 1)) (OptionalIntOrTuple_none)) (NDArray_scalar (Value_int (NDArray_size x))) :ruleset array_api_ruleset)\n(rewrite (sum (astype (TupleNDArray___getitem__ (unique_counts x) (Int___init__ 1)) dtype) (OptionalIntOrTuple_none)) (astype (NDArray_scalar (Value_int (NDArray_size x))) dtype) :ruleset array_api_ruleset)\n(rewrite (NDArray_dtype (astype x dtype)) dtype :ruleset array_api_ruleset)\n(function DType_float64 () DType)\n(rewrite (astype (NDArray_scalar (Value_int (Int___init__ i))) (DType_float64)) (NDArray_scalar (Value_float (Float___init__ (to-f64 i)))) :ruleset array_api_ruleset)\n(sort OptionalInt)\n(function concat (TupleNDArray OptionalInt) NDArray)\n(function TupleNDArray___init__ (NDArray) TupleNDArray)\n(function OptionalInt_none () OptionalInt)\n(rewrite (concat (TupleNDArray___init__ x) (OptionalInt_none)) x :ruleset array_api_ruleset)\n(rewrite (unique_values (unique_values x)) (unique_values x) :ruleset array_api_ruleset)\n(rewrite (sum (NDArray___truediv__ x (NDArray_scalar v)) (OptionalIntOrTuple_none)) (NDArray___truediv__ (sum x (OptionalIntOrTuple_none)) (NDArray_scalar v)) :ruleset array_api_ruleset)\n(function NDArray_ndim (NDArray) Int)\n(sort OptionalDType)\n(sort OptionalDevice)\n(function asarray (NDArray OptionalDType OptionalBool OptionalDevice) NDArray)\n(function OptionalDevice_none () OptionalDevice)\n(rewrite (NDArray_ndim (asarray a d ob (OptionalDevice_none))) (NDArray_ndim a) :ruleset array_api_ruleset)\n(function OptionalDType_none () OptionalDType)\n(function OptionalBool_none () OptionalBool)\n(rewrite (asarray a (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) a :ruleset array_api_ruleset)\n(function TupleNDArray___add__ (TupleNDArray TupleNDArray) TupleNDArray)\n(function TupleNDArray_EMPTY () TupleNDArray)\n(rewrite (TupleNDArray___add__ ti (TupleNDArray_EMPTY)) ti :ruleset array_api_ruleset)\n(rewrite (TupleNDArray_length (TupleNDArray___init__ n)) (Int___init__ 1) :ruleset array_api_ruleset)\n(rewrite (TupleNDArray_length (TupleNDArray___add__ ti ti2)) (Int___add__ (TupleNDArray_length ti) (TupleNDArray_length ti2)) :ruleset array_api_ruleset)\n(sort UnstableFn_Value_TupleInt (UnstableFn (TupleInt) Value))\n(function NDArray___init__ (TupleInt DType UnstableFn_Value_TupleInt) NDArray)\n(rewrite (NDArray_shape (NDArray___init__ shape dtype idx_fn)) shape :ruleset array_api_ruleset)\n(rewrite (NDArray_dtype (NDArray___init__ shape dtype idx_fn)) dtype :ruleset array_api_ruleset)\n(rewrite (NDArray_ndim x) (TupleInt_length (NDArray_shape x)) :ruleset array_api_ruleset)\n(function NDArray_to_value (NDArray) Value)\n(rewrite (NDArray_to_value x) (NDArray_index x (TupleInt_EMPTY)) :ruleset array_api_ruleset)\n(rewrite (NDArray___truediv__ (NDArray_scalar (Value_float f)) (NDArray_scalar (Value_float f))) (NDArray_scalar (Value_float (Float___init__ 1.0))) :ruleset array_api_ruleset)\n(function NDArray___sub__ (NDArray NDArray) NDArray)\n(rewrite (NDArray___sub__ (NDArray_scalar (Value_float f)) (NDArray_scalar (Value_float f))) (NDArray_scalar (Value_float (Float___init__ 0.0))) :ruleset array_api_ruleset)\n(function NDArray___gt__ (NDArray NDArray) NDArray)\n(rewrite (NDArray___gt__ (NDArray_scalar (Value_float (Float___init__ fi1))) (NDArray_scalar (Value_float (Float___init__ fi2)))) (NDArray_scalar (Value_bool (TRUE))) :when ((> fi1 fi2)) :ruleset array_api_ruleset)\n(rewrite (NDArray___gt__ (NDArray_scalar (Value_float (Float___init__ fi1))) (NDArray_scalar (Value_float (Float___init__ fi2)))) (NDArray_scalar (Value_bool (FALSE))) :when ((<= fi1 fi2)) :ruleset array_api_ruleset)\n(function NDArray_T (NDArray) NDArray)\n(rewrite (NDArray_T (NDArray_T x)) x :ruleset array_api_ruleset)\n(function TupleValue___add__ (TupleValue TupleValue) TupleValue)\n(function TupleValue_EMPTY () TupleValue)\n(rewrite (TupleValue___add__ ti (TupleValue_EMPTY)) ti :ruleset array_api_ruleset)\n(rewrite (TupleValue_length (TupleValue_EMPTY)) (Int___init__ 0) :ruleset array_api_ruleset)\n(rewrite (TupleValue_length (TupleValue___init__ v)) (Int___init__ 1) :ruleset array_api_ruleset)\n(rewrite (TupleValue_length (TupleValue___add__ ti ti2)) (Int___add__ (TupleValue_length ti) (TupleValue_length ti2)) :ruleset array_api_ruleset)\n(rewrite (TupleValue___getitem__ (TupleValue___init__ v) (Int___init__ 0)) v :ruleset array_api_ruleset)\n(rewrite (TupleValue___getitem__ (TupleValue___add__ (TupleValue___init__ v) ti) (Int___init__ 0)) v :ruleset array_api_ruleset)\n(rule ((= v (TupleValue___getitem__ (TupleValue___add__ (TupleValue___init__ v2) ti) (Int___init__ k)))\n (> k 0))\n ((union v (TupleValue___getitem__ ti (Int___init__ (- k 1)))))\n :ruleset array_api_ruleset )\n(rewrite (TupleValue_includes (TupleValue_EMPTY) v) (FALSE) :ruleset array_api_ruleset)\n(rewrite (TupleValue_includes (TupleValue___init__ v) v) (TRUE) :ruleset array_api_ruleset)\n(rewrite (TupleValue_includes (TupleValue___init__ v) v2) (FALSE) :when ((!= v v2)) :ruleset array_api_ruleset)\n(rewrite (TupleValue_includes (TupleValue___add__ ti ti2) v) (Boolean___or__ (TupleValue_includes ti v) (TupleValue_includes ti2 v)) :ruleset array_api_ruleset)\n(function DType_int64 () DType)\n(rewrite (Value_dtype (Value_int i)) (DType_int64) :ruleset array_api_ruleset)\n(rewrite (Value_dtype (Value_float f)) (DType_float64) :ruleset array_api_ruleset)\n(function DType_bool () DType)\n(rewrite (Value_dtype (Value_bool b)) (DType_bool) :ruleset array_api_ruleset)\n(function Value_to_bool (Value) Boolean)\n(rewrite (Value_to_bool (Value_bool b)) b :ruleset array_api_ruleset)\n(function Value_to_int (Value) Int)\n(rewrite (Value_to_int (Value_int i)) i :ruleset array_api_ruleset)\n(rewrite (Value_to_truthy_value (Value_bool b)) (Value_bool b) :ruleset array_api_ruleset)\n(sort IsDtypeKind)\n(function isdtype (DType IsDtypeKind) Boolean)\n(function DType_float32 () DType)\n(function IsDtypeKind_string (String) IsDtypeKind)\n(rewrite (isdtype (DType_float32) (IsDtypeKind_string \"integral\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_float64) (IsDtypeKind_string \"integral\")) (FALSE) :ruleset array_api_ruleset)\n(function DType_object () DType)\n(rewrite (isdtype (DType_object) (IsDtypeKind_string \"integral\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_int64) (IsDtypeKind_string \"integral\")) (TRUE) :ruleset array_api_ruleset)\n(function DType_int32 () DType)\n(rewrite (isdtype (DType_int32) (IsDtypeKind_string \"integral\")) (TRUE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_float32) (IsDtypeKind_string \"real floating\")) (TRUE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_float64) (IsDtypeKind_string \"real floating\")) (TRUE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_object) (IsDtypeKind_string \"real floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_int64) (IsDtypeKind_string \"real floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_int32) (IsDtypeKind_string \"real floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_float32) (IsDtypeKind_string \"complex floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_float64) (IsDtypeKind_string \"complex floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_object) (IsDtypeKind_string \"complex floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_int64) (IsDtypeKind_string \"complex floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_int32) (IsDtypeKind_string \"complex floating\")) (FALSE) :ruleset array_api_ruleset)\n(function IsDtypeKind_NULL () IsDtypeKind)\n(rewrite (isdtype d (IsDtypeKind_NULL)) (FALSE) :ruleset array_api_ruleset)\n(function IsDtypeKind_dtype (DType) IsDtypeKind)\n(rewrite (isdtype d (IsDtypeKind_dtype d)) (TRUE) :ruleset array_api_ruleset)\n(function IsDtypeKind___or__ (IsDtypeKind IsDtypeKind) IsDtypeKind :cost 10)\n(rewrite (isdtype d (IsDtypeKind___or__ k1 k2)) (Boolean___or__ (isdtype d k1) (isdtype d k2)) :ruleset array_api_ruleset)\n(rewrite (IsDtypeKind___or__ k1 (IsDtypeKind_NULL)) k1 :ruleset array_api_ruleset)\n(function DType___eq__ (DType DType) Boolean)\n(rewrite (DType___eq__ (DType_float64) (DType_float64)) (TRUE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float64) (DType_float32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float64) (DType_int32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float64) (DType_int64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float64) (DType_object)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float32) (DType_float64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float32) (DType_float32)) (TRUE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float32) (DType_int32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float32) (DType_int64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float32) (DType_object)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int32) (DType_float64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int32) (DType_float32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int32) (DType_int32)) (TRUE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int32) (DType_int64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int32) (DType_object)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int64) (DType_float64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int64) (DType_float32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int64) (DType_int32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int64) (DType_int64)) (TRUE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int64) (DType_object)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_object) (DType_float64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_object) (DType_float32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_object) (DType_int32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_object) (DType_int64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_object) (DType_object)) (TRUE) :ruleset array_api_ruleset)\n(function idx_fn-UnstableFn_Int_Int_i-Int__unstable-app_idx_fn__Int___add___i__Int___init___1___ (UnstableFn_Int_Int Int) Int)\n(rewrite (idx_fn-UnstableFn_Int_Int_i-Int__unstable-app_idx_fn__Int___add___i__Int___init___1___ idx_fn i) (unstable-app idx_fn (Int___add__ i (Int___init__ 1))) :ruleset array_api_ruleset)\n(rewrite (TupleInt_length (TupleInt___init__ i idx_fn)) i :ruleset array_api_ruleset)\n(rewrite (TupleInt___getitem__ (TupleInt___init__ i idx_fn) i2) (unstable-app idx_fn i2) :ruleset array_api_ruleset)\n(rewrite (index_vec_int vs (Int___init__ k)) (vec-get vs k) :when ((> (vec-length vs) k)) :ruleset array_api_ruleset)\n(rewrite (TupleInt_fold (TupleInt___init__ (Int___init__ 0) idx_fn) i f) i :ruleset array_api_ruleset)\n(rewrite (TupleInt_fold (TupleInt___init__ (Int___init__ k) idx_fn) i f) (unstable-app f (TupleInt_fold (TupleInt___init__ (Int___init__ (- k 1)) (unstable-fn \"idx_fn-UnstableFn_Int_Int_i-Int__unstable-app_idx_fn__Int___add___i__Int___init___1___\" idx_fn)) i f) (unstable-app idx_fn (Int___init__ 0))) :when ((!= k 0)) :ruleset array_api_ruleset)\n(rewrite (TupleInt_fold_boolean (TupleInt___init__ (Int___init__ 0) idx_fn) b bool_f) b :ruleset array_api_ruleset)\n(rewrite (TupleInt_fold_boolean (TupleInt___init__ (Int___init__ k) idx_fn) b bool_f) (unstable-app bool_f (TupleInt_fold_boolean (TupleInt___init__ (Int___init__ (- k 1)) (unstable-fn \"idx_fn-UnstableFn_Int_Int_i-Int__unstable-app_idx_fn__Int___add___i__Int___init___1___\" idx_fn)) b bool_f) (unstable-app idx_fn (Int___init__ 0))) :when ((!= k 0)) :ruleset array_api_ruleset)\n(sort UnstableFn_Boolean_Int (UnstableFn (Int) Boolean))\n(function TupleInt_filter (TupleInt UnstableFn_Boolean_Int) TupleInt :cost 100)\n(rewrite (TupleInt_filter (TupleInt___init__ (Int___init__ 0) idx_fn) filter_f) (TupleInt___init__ (Int___init__ 0) idx_fn) :ruleset array_api_ruleset)\n(function TupleInt_if_ (Boolean TupleInt TupleInt) TupleInt)\n(rewrite (TupleInt_filter (TupleInt___init__ (Int___init__ k) idx_fn) filter_f) (TupleInt_if_ (unstable-app filter_f (unstable-app idx_fn (Int___init__ k))) (TupleInt___add__ (TupleInt_single (unstable-app idx_fn (Int___init__ k))) (TupleInt_filter (TupleInt___init__ (Int___init__ (- k 1)) (unstable-fn \"idx_fn-UnstableFn_Int_Int_i-Int__unstable-app_idx_fn__Int___add___i__Int___init___1___\" idx_fn)) filter_f)) (TupleInt_filter (TupleInt___init__ (Int___init__ (- k 1)) (unstable-fn \"idx_fn-UnstableFn_Int_Int_i-Int__unstable-app_idx_fn__Int___add___i__Int___init___1___\" idx_fn)) filter_f)) :when ((!= k 0)) :ruleset array_api_ruleset)\n(function bottom_indexing (Int) Int)\n(rewrite (TupleInt_EMPTY) (TupleInt___init__ (Int___init__ 0) (unstable-fn \"bottom_indexing\")) :ruleset array_api_ruleset)\n(rewrite (TupleInt_if_ (TRUE) ti ti2) ti :ruleset array_api_ruleset)\n(rewrite (TupleInt_if_ (FALSE) ti ti2) ti2 :ruleset array_api_ruleset)\n(rewrite (Float_abs (Float___init__ f)) (Float___init__ f) :when ((>= f 0.0)) :ruleset array_api_ruleset)\n(rewrite (Float_abs (Float___init__ f)) (Float___init__ (neg f)) :when ((< f 0.0)) :ruleset array_api_ruleset)\n(function Float_rational (Rational) Float :cost 2)\n(rewrite (Float___init__ f) (Float_rational (rational (to-i64 f) 1)) :when ((= (to-f64 (to-i64 f)) f)) :ruleset array_api_ruleset)\n(function Float_from_int (Int) Float)\n(rewrite (Float_from_int (Int___init__ i)) (Float_rational (rational i 1)) :ruleset array_api_ruleset)\n(function Float___add__ (Float Float) Float)\n(rewrite (Float___add__ (Float___init__ f) (Float___init__ f2)) (Float___init__ (+ f f2)) :ruleset array_api_ruleset)\n(function Float___sub__ (Float Float) Float)\n(rewrite (Float___sub__ (Float___init__ f) (Float___init__ f2)) (Float___init__ (- f f2)) :ruleset array_api_ruleset)\n(function Float___mul__ (Float Float) Float)\n(rewrite (Float___mul__ (Float___init__ f) (Float___init__ f2)) (Float___init__ (* f f2)) :ruleset array_api_ruleset)\n(function Float___truediv__ (Float Float) Float)\n(rewrite (Float___truediv__ (Float_rational r) (Float_rational r1)) (Float_rational (/ r r1)) :ruleset array_api_ruleset)\n(rewrite (Float___add__ (Float_rational r) (Float_rational r1)) (Float_rational (+ r r1)) :ruleset array_api_ruleset)\n(rewrite (Float___sub__ (Float_rational r) (Float_rational r1)) (Float_rational (- r r1)) :ruleset array_api_ruleset)\n(rewrite (Float___mul__ (Float_rational r) (Float_rational r1)) (Float_rational (* r r1)) :ruleset array_api_ruleset)\n(rewrite (Int___eq__ (Int___init__ i) (Int___init__ i)) (TRUE) :ruleset array_api_ruleset)\n(rule ((= r (Int___eq__ (Int___init__ i) (Int___init__ j)))\n (!= i j))\n ((union r (FALSE)))\n :ruleset array_api_ruleset )\n(function Int___ge__ (Int Int) Boolean)\n(rewrite (Int___ge__ (Int___init__ i) (Int___init__ i)) (TRUE) :ruleset array_api_ruleset)\n(rule ((= r (Int___ge__ (Int___init__ i) (Int___init__ j)))\n (> i j))\n ((union r (TRUE)))\n :ruleset array_api_ruleset )\n(rule ((= r (Int___ge__ (Int___init__ i) (Int___init__ j)))\n (< i j))\n ((union r (FALSE)))\n :ruleset array_api_ruleset )\n(rewrite (Int___lt__ (Int___init__ i) (Int___init__ i)) (FALSE) :ruleset array_api_ruleset)\n(rule ((= r (Int___lt__ (Int___init__ i) (Int___init__ j)))\n (< i j))\n ((union r (TRUE)))\n :ruleset array_api_ruleset )\n(rule ((= r (Int___lt__ (Int___init__ i) (Int___init__ j)))\n (> i j))\n ((union r (FALSE)))\n :ruleset array_api_ruleset )\n(function Int___gt__ (Int Int) Boolean)\n(rewrite (Int___gt__ (Int___init__ i) (Int___init__ i)) (FALSE) :ruleset array_api_ruleset)\n(rule ((= r (Int___gt__ (Int___init__ i) (Int___init__ j)))\n (> i j))\n ((union r (TRUE)))\n :ruleset array_api_ruleset )\n(rule ((= r (Int___gt__ (Int___init__ i) (Int___init__ j)))\n (< i j))\n ((union r (FALSE)))\n :ruleset array_api_ruleset )\n(function Int_i64 (Int) i64)\n(rule ((= o (Int___init__ j)))\n ((set (Int_i64 o) j))\n :ruleset array_api_ruleset )\n(rewrite (Int___add__ (Int___init__ i) (Int___init__ j)) (Int___init__ (+ i j)) :ruleset array_api_ruleset)\n(rewrite (Int___sub__ (Int___init__ i) (Int___init__ j)) (Int___init__ (- i j)) :ruleset array_api_ruleset)\n(rewrite (Int___mul__ (Int___init__ i) (Int___init__ j)) (Int___init__ (* i j)) :ruleset array_api_ruleset)\n(function Int___truediv__ (Int Int) Int)\n(rewrite (Int___truediv__ (Int___init__ i) (Int___init__ j)) (Int___init__ (/ i j)) :ruleset array_api_ruleset)\n(function Int___mod__ (Int Int) Int)\n(rewrite (Int___mod__ (Int___init__ i) (Int___init__ j)) (Int___init__ (% i j)) :ruleset array_api_ruleset)\n(function Int___and__ (Int Int) Int)\n(rewrite (Int___and__ (Int___init__ i) (Int___init__ j)) (Int___init__ (& i j)) :ruleset array_api_ruleset)\n(function Int___or__ (Int Int) Int)\n(rewrite (Int___or__ (Int___init__ i) (Int___init__ j)) (Int___init__ (| i j)) :ruleset array_api_ruleset)\n(function Int___xor__ (Int Int) Int)\n(rewrite (Int___xor__ (Int___init__ i) (Int___init__ j)) (Int___init__ (^ i j)) :ruleset array_api_ruleset)\n(function Int___lshift__ (Int Int) Int)\n(rewrite (Int___lshift__ (Int___init__ i) (Int___init__ j)) (Int___init__ (<< i j)) :ruleset array_api_ruleset)\n(function Int___rshift__ (Int Int) Int)\n(rewrite (Int___rshift__ (Int___init__ i) (Int___init__ j)) (Int___init__ (>> i j)) :ruleset array_api_ruleset)\n(function Int___invert__ (Int) Int)\n(rewrite (Int___invert__ (Int___init__ i)) (Int___init__ (not-i64 i)) :ruleset array_api_ruleset)\n(rewrite (Int_if_ (TRUE) o b) o :ruleset array_api_ruleset)\n(rewrite (Int_if_ (FALSE) o b) b :ruleset array_api_ruleset)\n(function Boolean_bool (Boolean) bool)\n(rule ((= x (TRUE)))\n ((set (Boolean_bool x) true))\n :ruleset array_api_ruleset )\n(rule ((= x (FALSE)))\n ((set (Boolean_bool x) false))\n :ruleset array_api_ruleset )\n(rewrite (Boolean___or__ (TRUE) x) (TRUE) :ruleset array_api_ruleset)\n(rewrite (Boolean___or__ (FALSE) x) x :ruleset array_api_ruleset)\n(function Boolean___and__ (Boolean Boolean) Boolean)\n(rewrite (Boolean___and__ (TRUE) x) x :ruleset array_api_ruleset)\n(rewrite (Boolean___and__ (FALSE) x) (FALSE) :ruleset array_api_ruleset)\n(function Boolean_if_int (Boolean Int Int) Int)\n(rewrite (Boolean_if_int (TRUE) i j) i :ruleset array_api_ruleset)\n(rewrite (Boolean_if_int (FALSE) i j) j :ruleset array_api_ruleset)\n(function Boolean___invert__ (Boolean) Boolean)\n(rewrite (Boolean___invert__ (TRUE)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (Boolean___invert__ (FALSE)) (TRUE) :ruleset array_api_ruleset)\n(ruleset ruleset_5033605696)\n(function NDArray___eq__ (NDArray NDArray) NDArray)\n(rewrite (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse x) (Int___init__ 1)) (NDArray_scalar (Value_int i))) (NDArray___eq__ x (NDArray_scalar (NDArray_index (unique_values x) (TupleInt_from_vec (vec-of i))))) :subsume :ruleset ruleset_5033605696)\n(function count_values (NDArray NDArray) TupleValue :unextractable)\n(rewrite (TupleNDArray___getitem__ (unique_counts x) (Int___init__ 1)) (NDArray_vector (count_values x (unique_values x))) :subsume :ruleset ruleset_5033605696)\n(rewrite (count_values x (NDArray_vector (TupleValue___add__ (TupleValue___init__ v) tv))) (TupleValue___add__ (TupleValue___init__ (NDArray_to_value (sum (NDArray___eq__ x (NDArray_scalar v)) (OptionalIntOrTuple_none)))) (count_values x (NDArray_vector tv))) :subsume :ruleset ruleset_5033605696)\n(rewrite (count_values x (NDArray_vector (TupleValue___init__ v))) (TupleValue___init__ (NDArray_to_value (sum (NDArray___eq__ x (NDArray_scalar v)) (OptionalIntOrTuple_none)))) :subsume :ruleset ruleset_5033605696)\n(function std (NDArray OptionalIntOrTuple) NDArray)\n(sort IntOrTuple)\n(function OptionalIntOrTuple_some (IntOrTuple) OptionalIntOrTuple)\n(function IntOrTuple_int (Int) IntOrTuple)\n(function ndarray-sqrt (NDArray) NDArray)\n(function mean (NDArray OptionalIntOrTuple Boolean) NDArray)\n(function square (NDArray) NDArray)\n(rewrite (std x (OptionalIntOrTuple_some (IntOrTuple_int i))) (ndarray-sqrt (mean (square (NDArray___sub__ x (mean x (OptionalIntOrTuple_some (IntOrTuple_int i)) (TRUE)))) (OptionalIntOrTuple_some (IntOrTuple_int i)) (FALSE))) :subsume :ruleset ruleset_5033605696)\n(rewrite (mean x (OptionalIntOrTuple_some (IntOrTuple_int i)) (FALSE)) (NDArray___truediv__ (sum x (OptionalIntOrTuple_some (IntOrTuple_int i))) (NDArray_scalar (Value_int (TupleInt___getitem__ (NDArray_shape x) i)))) :subsume :ruleset ruleset_5033605696)\n(function expand_dims (NDArray Int) NDArray)\n(rewrite (mean x (OptionalIntOrTuple_some (IntOrTuple_int i)) (TRUE)) (expand_dims (NDArray___truediv__ (sum x (OptionalIntOrTuple_some (IntOrTuple_int i))) (NDArray_scalar (Value_int (TupleInt___getitem__ (NDArray_shape x) i)))) i) :subsume :ruleset ruleset_5033605696)\n(let %__expr_-4122594143565222517 (OptionalBool_none))\n(let %__expr_-3674731718720096444 (OptionalDevice_none))\n(let %__expr_2091604061025500396 (OptionalDType_none))\n(function NDArray_var (String) NDArray :cost 200)\n(let %__expr_-5200143055942215294 (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444) (TupleInt_from_vec (vec-of (Int___init__ -1))) %__expr_-4122594143565222517) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))\n(let %__expr_3300329792522185471 (Int___init__ 1))\n(let %__expr_-7942988945600443502 (Int___init__ 0))\n(let %__expr_2407075622821899710 (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray %__expr_-5200143055942215294 %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none)))) %__expr_-7942988945600443502))\n(let %__expr_-143818766793636568 (OptionalInt_none))\n(let %__expr_2305922367412063525 (Int___init__ 2))\n(let %__expr_-1113027338580586528 (unique_values (concat (TupleNDArray___init__ (unique_values (asarray %__expr_-5200143055942215294 %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))) (OptionalInt_none))))\n(let %__expr_4326809257670680665 (IndexKey_int %__expr_-7942988945600443502))\n(let %__expr_-6932009612334166206 (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_-7942988945600443502))\n(sort MultiAxisIndexKey)\n(function IndexKey_multi_axis (MultiAxisIndexKey) IndexKey)\n(sort MultiAxisIndexKeyItem)\n(sort Vec_MultiAxisIndexKeyItem (Vec MultiAxisIndexKeyItem))\n(function MultiAxisIndexKey_from_vec (Vec_MultiAxisIndexKeyItem) MultiAxisIndexKey)\n(function MultiAxisIndexKeyItem_int (Int) MultiAxisIndexKeyItem)\n(sort Slice)\n(function MultiAxisIndexKeyItem_slice (Slice) MultiAxisIndexKeyItem)\n(function Slice___init__ (OptionalInt OptionalInt OptionalInt) Slice)\n(let %__expr_-954298076671303615 (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int %__expr_2305922367412063525) (MultiAxisIndexKeyItem_slice (Slice___init__ %__expr_-143818766793636568 %__expr_-143818766793636568 %__expr_-143818766793636568))))))\n(let %__expr_483064111004974365 (Float___init__ 1.0))\n(let %__expr_-3520630818915629594 (Int___init__ 150))\n(let %__expr_-6765600943420531488 (Value_int (Int___init__ 2)))\n(let %__expr_-622493510873225930 (Value_int (Int___init__ 1)))\n(let %__expr_478758938070675600 (Value_int (Int___init__ 0)))\n(let %__expr_-8664633617851008504 (unique_inverse %__expr_-5200143055942215294))\n(let %__expr_-8613124149453883591 (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444))\n(let %__expr_-8637348939342624324 (MultiAxisIndexKeyItem_slice (Slice___init__ %__expr_-143818766793636568 %__expr_-143818766793636568 %__expr_-143818766793636568)))\n(let %__expr_-2704792733181451377 (TupleNDArray___getitem__ %__expr_-8664633617851008504 %__expr_3300329792522185471))\n(let %__expr_1913846200346632608 (OptionalIntOrTuple_some (IntOrTuple_int %__expr_-7942988945600443502)))\n(let %__expr_6185990579165616281 (FALSE))\n(function NDArray___setitem__ (NDArray IndexKey NDArray) NDArray)\n(function zeros (TupleInt OptionalDType OptionalDevice) NDArray)\n(function OptionalDType_some (DType) OptionalDType)\n(sort Device)\n(function OptionalDevice_some (Device) OptionalDevice)\n(function NDArray_device (NDArray) Device)\n(function IndexKey_ndarray (NDArray) IndexKey)\n(let %__expr_7843526591494960327 (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ %__expr_-8664633617851008504 %__expr_-7942988945600443502)) %__expr_-7942988945600443502) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) %__expr_3300329792522185471))) (OptionalDType_some (NDArray_dtype %__expr_-8613124149453883591)) (OptionalDevice_some (NDArray_device %__expr_-8613124149453883591))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int %__expr_-7942988945600443502) %__expr_-8637348939342624324))) (mean (NDArray___getitem__ %__expr_-8613124149453883591 (IndexKey_ndarray (NDArray___eq__ %__expr_-2704792733181451377 (NDArray_scalar %__expr_478758938070675600)))) %__expr_1913846200346632608 %__expr_6185990579165616281)) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int %__expr_3300329792522185471) %__expr_-8637348939342624324))) (mean (NDArray___getitem__ %__expr_-8613124149453883591 (IndexKey_ndarray (NDArray___eq__ %__expr_-2704792733181451377 (NDArray_scalar %__expr_-622493510873225930)))) %__expr_1913846200346632608 %__expr_6185990579165616281)) %__expr_-954298076671303615 (mean (NDArray___getitem__ %__expr_-8613124149453883591 (IndexKey_ndarray (NDArray___eq__ %__expr_-2704792733181451377 (NDArray_scalar %__expr_-6765600943420531488)))) %__expr_1913846200346632608 %__expr_6185990579165616281)))\n(let %__expr_7180621784385959982 (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int %__expr_3300329792522185471) %__expr_-8637348939342624324))))\n(let %__expr_-3283806677371465170 (NDArray_scalar %__expr_478758938070675600))\n(let %__expr_-4323225966908438009 (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int %__expr_-7942988945600443502) %__expr_-8637348939342624324))))\n(let %__expr_-8475266842302933511 (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)))\n(function OptionalInt_some (Int) OptionalInt)\n(let %__expr_3049932803880609425 (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ %__expr_-8613124149453883591 (IndexKey_ndarray (NDArray___eq__ %__expr_-5200143055942215294 (NDArray___getitem__ %__expr_-1113027338580586528 %__expr_4326809257670680665)))) (NDArray___getitem__ %__expr_7843526591494960327 %__expr_-4323225966908438009))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ %__expr_-8613124149453883591 (IndexKey_ndarray (NDArray___eq__ %__expr_-5200143055942215294 (NDArray___getitem__ %__expr_-1113027338580586528 (IndexKey_int %__expr_3300329792522185471))))) (NDArray___getitem__ %__expr_7843526591494960327 %__expr_7180621784385959982))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ %__expr_-8613124149453883591 (IndexKey_ndarray (NDArray___eq__ %__expr_-5200143055942215294 (NDArray___getitem__ %__expr_-1113027338580586528 (IndexKey_int %__expr_2305922367412063525))))) (NDArray___getitem__ %__expr_7843526591494960327 %__expr_-954298076671303615))))) (OptionalInt_some %__expr_-7942988945600443502)) %__expr_1913846200346632608))\n(let %__expr_-671931098406187877 (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ %__expr_-8613124149453883591 (IndexKey_ndarray (NDArray___eq__ %__expr_-5200143055942215294 (NDArray___getitem__ %__expr_-1113027338580586528 %__expr_4326809257670680665)))) (NDArray___getitem__ %__expr_7843526591494960327 %__expr_-4323225966908438009))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ %__expr_-8613124149453883591 (IndexKey_ndarray (NDArray___eq__ %__expr_-5200143055942215294 (NDArray___getitem__ %__expr_-1113027338580586528 (IndexKey_int %__expr_3300329792522185471))))) (NDArray___getitem__ %__expr_7843526591494960327 %__expr_7180621784385959982))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ %__expr_-8613124149453883591 (IndexKey_ndarray (NDArray___eq__ %__expr_-5200143055942215294 (NDArray___getitem__ %__expr_-1113027338580586528 (IndexKey_int %__expr_2305922367412063525))))) (NDArray___getitem__ %__expr_7843526591494960327 %__expr_-954298076671303615))))) (OptionalInt_some %__expr_-7942988945600443502)))\n(function NDArray___mul__ (NDArray NDArray) NDArray)\n(let %__expr_-1459297673498492435 (Slice___init__ %__expr_-143818766793636568 (OptionalInt_some (Value_to_int (NDArray_to_value (sum (astype (NDArray___gt__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ %__expr_483064111004974365 (Float_from_int (Int___sub__ %__expr_-6932009612334166206 %__expr_2407075622821899710))))) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) (NDArray___truediv__ %__expr_-671931098406187877 (NDArray___setitem__ %__expr_3049932803880609425 (IndexKey_ndarray (NDArray___eq__ %__expr_3049932803880609425 %__expr_-3283806677371465170)) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) %__expr_6185990579165616281) %__expr_3300329792522185471) (NDArray_scalar (Value_float (Float___init__ 0.0001)))) (DType_int32)) (OptionalIntOrTuple_none))))) %__expr_-143818766793636568))\n(let %__expr_4799320818084596281 (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ %__expr_483064111004974365 (Float_from_int (Int___sub__ %__expr_-6932009612334166206 %__expr_2407075622821899710))))) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) (NDArray___truediv__ %__expr_-671931098406187877 (NDArray___setitem__ %__expr_3049932803880609425 (IndexKey_ndarray (NDArray___eq__ %__expr_3049932803880609425 %__expr_-3283806677371465170)) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) %__expr_6185990579165616281))\n(let %__expr_-4744074158064860754 (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ %__expr_483064111004974365 (Float_from_int (Int___sub__ %__expr_-6932009612334166206 %__expr_2407075622821899710))))) %__expr_2091604061025500396 %__expr_-4122594143565222517 %__expr_-3674731718720096444)) (NDArray___truediv__ %__expr_-671931098406187877 (NDArray___setitem__ %__expr_3049932803880609425 (IndexKey_ndarray (NDArray___eq__ %__expr_3049932803880609425 %__expr_-3283806677371465170)) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) %__expr_6185990579165616281) %__expr_3300329792522185471))\n(let %__expr_2307122782736907488 (NDArray___setitem__ %__expr_3049932803880609425 (IndexKey_ndarray (NDArray___eq__ %__expr_3049932803880609425 %__expr_-3283806677371465170)) (NDArray_scalar (Value_float (Float___init__ 1.0)))))\n(function NDArray___matmul__ (NDArray NDArray) NDArray)\n(function IndexKey_slice (Slice) IndexKey)\n(let %__expr_270530672567316052 (TupleNDArray___getitem__ (svd (NDArray___matmul__ (NDArray_T (NDArray___mul__ (ndarray-sqrt (NDArray___mul__ (NDArray___mul__ (NDArray_scalar (Value_int %__expr_-6932009612334166206)) (NDArray___truediv__ (astype (TupleNDArray___getitem__ (unique_counts %__expr_-5200143055942215294) %__expr_3300329792522185471) (NDArray_dtype %__expr_-8613124149453883591)) (NDArray_scalar (Value_float (Float___init__ 150.0))))) (NDArray_scalar (Value_float (Float___truediv__ %__expr_483064111004974365 (Float_from_int (Int___sub__ %__expr_2407075622821899710 %__expr_3300329792522185471))))))) (NDArray_T (NDArray___sub__ %__expr_7843526591494960327 (NDArray___matmul__ (NDArray___truediv__ (astype (TupleNDArray___getitem__ (unique_counts %__expr_-5200143055942215294) %__expr_3300329792522185471) (NDArray_dtype %__expr_-8613124149453883591)) (NDArray_scalar (Value_float (Float___init__ 150.0)))) %__expr_7843526591494960327))))) (NDArray___truediv__ (NDArray_T (NDArray___truediv__ (NDArray___getitem__ (TupleNDArray___getitem__ %__expr_4799320818084596281 %__expr_2305922367412063525) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_slice %__expr_-1459297673498492435) %__expr_-8637348939342624324)))) %__expr_2307122782736907488)) (NDArray___getitem__ %__expr_-4744074158064860754 (IndexKey_slice %__expr_-1459297673498492435)))) %__expr_6185990579165616281) %__expr_3300329792522185471))\n(let %__expr_-5540247018246576406 (NDArray___truediv__ (astype (TupleNDArray___getitem__ (unique_counts %__expr_-5200143055942215294) %__expr_3300329792522185471) (NDArray_dtype %__expr_-8613124149453883591)) (NDArray_scalar (Value_float (Float___init__ 150.0)))))\n(let %__expr_-5933626871507061239 (svd (NDArray___matmul__ (NDArray_T (NDArray___mul__ (ndarray-sqrt (NDArray___mul__ (NDArray___mul__ (NDArray_scalar (Value_int %__expr_-6932009612334166206)) (NDArray___truediv__ (astype (TupleNDArray___getitem__ (unique_counts %__expr_-5200143055942215294) %__expr_3300329792522185471) (NDArray_dtype %__expr_-8613124149453883591)) (NDArray_scalar (Value_float (Float___init__ 150.0))))) (NDArray_scalar (Value_float (Float___truediv__ %__expr_483064111004974365 (Float_from_int (Int___sub__ %__expr_2407075622821899710 %__expr_3300329792522185471))))))) (NDArray_T (NDArray___sub__ %__expr_7843526591494960327 (NDArray___matmul__ (NDArray___truediv__ (astype (TupleNDArray___getitem__ (unique_counts %__expr_-5200143055942215294) %__expr_3300329792522185471) (NDArray_dtype %__expr_-8613124149453883591)) (NDArray_scalar (Value_float (Float___init__ 150.0)))) %__expr_7843526591494960327))))) (NDArray___truediv__ (NDArray_T (NDArray___truediv__ (NDArray___getitem__ (TupleNDArray___getitem__ %__expr_4799320818084596281 %__expr_2305922367412063525) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_slice %__expr_-1459297673498492435) %__expr_-8637348939342624324)))) %__expr_2307122782736907488)) (NDArray___getitem__ %__expr_-4744074158064860754 (IndexKey_slice %__expr_-1459297673498492435)))) %__expr_6185990579165616281))\n(let %__expr_-4180228001421012884 (NDArray_scalar (Value_float (Float___init__ 0.0001))))\n(let %__expr_-3501279694271260104 (DType_int32))\n(let %__expr_5981948135265815040 (OptionalIntOrTuple_none))\n(let %__expr_2917853313867759590 (NDArray_dtype %__expr_-8613124149453883591))\n(let %__expr_-5161099022452562755 (NDArray___matmul__ (NDArray___truediv__ (astype (TupleNDArray___getitem__ (unique_counts %__expr_-5200143055942215294) %__expr_3300329792522185471) (NDArray_dtype %__expr_-8613124149453883591)) (NDArray_scalar (Value_float (Float___init__ 150.0)))) %__expr_7843526591494960327))\n(let %__expr_7947521701427986423 (NDArray___truediv__ (NDArray_T (NDArray___truediv__ (NDArray___getitem__ (TupleNDArray___getitem__ %__expr_4799320818084596281 %__expr_2305922367412063525) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_slice %__expr_-1459297673498492435) %__expr_-8637348939342624324)))) %__expr_2307122782736907488)) (NDArray___getitem__ %__expr_-4744074158064860754 (IndexKey_slice %__expr_-1459297673498492435))))\n(simplify (saturate (seq (run array_api_ruleset) (run ruleset_5033605696))) (NDArray___getitem__ (NDArray___matmul__ (NDArray___sub__ %__expr_-8613124149453883591 %__expr_-5161099022452562755) (NDArray___matmul__ %__expr_7947521701427986423 (NDArray___getitem__ (NDArray_T (TupleNDArray___getitem__ %__expr_-5933626871507061239 %__expr_2305922367412063525)) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of %__expr_-8637348939342624324 (MultiAxisIndexKeyItem_slice (Slice___init__ %__expr_-143818766793636568 (OptionalInt_some (Value_to_int (NDArray_to_value (sum (astype (NDArray___gt__ %__expr_270530672567316052 (NDArray___mul__ %__expr_-4180228001421012884 (NDArray___getitem__ %__expr_270530672567316052 %__expr_4326809257670680665))) %__expr_-3501279694271260104) %__expr_5981948135265815040)))) %__expr_-143818766793636568)))))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of %__expr_-8637348939342624324 (MultiAxisIndexKeyItem_slice (Slice___init__ %__expr_-143818766793636568 (OptionalInt_some %__expr_2305922367412063525) %__expr_-143818766793636568)))))))\n(let %__expr_978886785202701864 (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of %__expr_-3520630818915629594 (Int___init__ 4))))))\n(let %__expr_3826936542596060759 (Int___init__ 4))\n(let %__expr_-8607724285922497289 (NDArray___getitem__ %__expr_978886785202701864 (IndexKey_ndarray (NDArray___eq__ (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of %__expr_-3520630818915629594))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (NDArray_scalar %__expr_-622493510873225930)))))\n(let %__expr_8779256037532389381 (NDArray___getitem__ %__expr_978886785202701864 (IndexKey_ndarray (NDArray___eq__ (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of %__expr_-3520630818915629594))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) %__expr_-3283806677371465170))))\n(let %__expr_2565664028803046192 (DType_float64))\n(let %__expr_3562727526135681919 (NDArray___getitem__ %__expr_978886785202701864 (IndexKey_ndarray (NDArray___eq__ (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of %__expr_-3520630818915629594))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (NDArray_scalar %__expr_-6765600943420531488)))))\n(let %__expr_5127641217187406832 (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of %__expr_-3520630818915629594))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))))\n(let %__expr_-5874110021677832412 (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int %__expr_-7942988945600443502) %__expr_-8637348939342624324))))\n(let %__expr_2924140249920978521 (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (Int___init__ 3) %__expr_3826936542596060759)) (OptionalDType_some %__expr_2565664028803046192) (OptionalDevice_some (NDArray_device %__expr_978886785202701864))) %__expr_-5874110021677832412 (NDArray___truediv__ (sum %__expr_8779256037532389381 %__expr_1913846200346632608) (NDArray_scalar (Value_int (TupleInt___getitem__ (NDArray_shape %__expr_8779256037532389381) %__expr_-7942988945600443502))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int %__expr_3300329792522185471) %__expr_-8637348939342624324))) (NDArray___truediv__ (sum %__expr_-8607724285922497289 %__expr_1913846200346632608) (NDArray_scalar (Value_int (TupleInt___getitem__ (NDArray_shape %__expr_-8607724285922497289) %__expr_-7942988945600443502))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int %__expr_2305922367412063525) %__expr_-8637348939342624324))) (NDArray___truediv__ (sum %__expr_3562727526135681919 %__expr_1913846200346632608) (NDArray_scalar (Value_int (TupleInt___getitem__ (NDArray_shape %__expr_3562727526135681919) %__expr_-7942988945600443502))))))\n(let %__expr_8582344284568866371 (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int %__expr_2305922367412063525) %__expr_-8637348939342624324))))\n(let %__expr_-3132706819403651174 (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ %__expr_8779256037532389381 (NDArray___getitem__ %__expr_2924140249920978521 %__expr_-5874110021677832412))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ %__expr_-8607724285922497289 (NDArray___getitem__ %__expr_2924140249920978521 (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int %__expr_3300329792522185471) %__expr_-8637348939342624324)))))) (TupleNDArray___init__ (NDArray___sub__ %__expr_3562727526135681919 (NDArray___getitem__ %__expr_2924140249920978521 %__expr_8582344284568866371))))) (OptionalInt_some %__expr_-7942988945600443502)))\n(let %__expr_755766186975356825 (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int %__expr_3300329792522185471) %__expr_-8637348939342624324))))\n(let %__expr_1540266631570115279 (NDArray___eq__ (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of %__expr_-3520630818915629594))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (NDArray_scalar %__expr_-622493510873225930)))\n(let %__expr_7382830492167037887 (square (NDArray___sub__ %__expr_-3132706819403651174 (expand_dims (NDArray___truediv__ (sum %__expr_-3132706819403651174 %__expr_1913846200346632608) (NDArray_scalar (Value_int (TupleInt___getitem__ (NDArray_shape %__expr_-3132706819403651174) %__expr_-7942988945600443502)))) %__expr_-7942988945600443502))))\n(let %__expr_-8085216922850384227 1)\n(let %__expr_-6293504624159906607 (ndarray-sqrt (NDArray___truediv__ (sum %__expr_7382830492167037887 %__expr_1913846200346632608) (NDArray_scalar (Value_int (TupleInt___getitem__ (NDArray_shape %__expr_7382830492167037887) %__expr_-7942988945600443502))))))\n(let %__expr_6749312899897339687 (Slice___init__ %__expr_-143818766793636568 (OptionalInt_some (Value_to_int (NDArray_to_value (sum (astype (NDArray___gt__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (NDArray_scalar (Value_float (Float_rational (rational %__expr_-8085216922850384227 147))))) (NDArray___truediv__ %__expr_-3132706819403651174 (NDArray___setitem__ %__expr_-6293504624159906607 (IndexKey_ndarray (NDArray___eq__ %__expr_-6293504624159906607 %__expr_-3283806677371465170)) (NDArray_scalar (Value_float (Float_rational (rational %__expr_-8085216922850384227 %__expr_-8085216922850384227))))))) %__expr_6185990579165616281) %__expr_3300329792522185471) %__expr_-4180228001421012884) %__expr_-3501279694271260104) %__expr_5981948135265815040)))) %__expr_-143818766793636568))\n(let %__expr_-5507881356079575778 (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (NDArray_scalar (Value_float (Float_rational (rational %__expr_-8085216922850384227 147))))) (NDArray___truediv__ %__expr_-3132706819403651174 (NDArray___setitem__ %__expr_-6293504624159906607 (IndexKey_ndarray (NDArray___eq__ %__expr_-6293504624159906607 %__expr_-3283806677371465170)) (NDArray_scalar (Value_float (Float_rational (rational %__expr_-8085216922850384227 %__expr_-8085216922850384227))))))) %__expr_6185990579165616281) %__expr_3300329792522185471))\n(let %__expr_-649824781713772813 (NDArray___eq__ (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of %__expr_-3520630818915629594))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) %__expr_-3283806677371465170))\n(let %__expr_-7715872950595615314 (svd (NDArray___mul__ (ndarray-sqrt (NDArray_scalar (Value_float (Float_rational (rational %__expr_-8085216922850384227 147))))) (NDArray___truediv__ %__expr_-3132706819403651174 (NDArray___setitem__ %__expr_-6293504624159906607 (IndexKey_ndarray (NDArray___eq__ %__expr_-6293504624159906607 %__expr_-3283806677371465170)) (NDArray_scalar (Value_float (Float_rational (rational %__expr_-8085216922850384227 %__expr_-8085216922850384227))))))) %__expr_6185990579165616281))\n(let %__expr_-3823036485969157667 150)\n(let %__expr_-5209865760313326585 (NDArray___truediv__ (astype (NDArray_vector (TupleValue___add__ (TupleValue___init__ (NDArray_to_value (sum %__expr_-649824781713772813 %__expr_5981948135265815040))) (TupleValue___add__ (TupleValue___init__ (NDArray_to_value (sum %__expr_1540266631570115279 %__expr_5981948135265815040))) (TupleValue___init__ (NDArray_to_value (sum (NDArray___eq__ (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of %__expr_-3520630818915629594))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (NDArray_scalar %__expr_-6765600943420531488)) %__expr_5981948135265815040)))))) %__expr_2565664028803046192) (NDArray_scalar (Value_float (Float_rational (rational %__expr_-3823036485969157667 %__expr_-8085216922850384227))))))\n(let %__expr_3134672938439589730 (NDArray___setitem__ %__expr_-6293504624159906607 (IndexKey_ndarray (NDArray___eq__ %__expr_-6293504624159906607 %__expr_-3283806677371465170)) (NDArray_scalar (Value_float (Float_rational (rational %__expr_-8085216922850384227 %__expr_-8085216922850384227))))))\n(let %__expr_2615935926139764667 (TupleNDArray___getitem__ (svd (NDArray___matmul__ (NDArray_T (NDArray___mul__ (ndarray-sqrt (NDArray___mul__ (NDArray___mul__ (NDArray_scalar (Value_int %__expr_-3520630818915629594)) %__expr_-5209865760313326585) (NDArray_scalar (Value_float (Float_rational (rational %__expr_-8085216922850384227 2)))))) (NDArray_T (NDArray___sub__ %__expr_2924140249920978521 (NDArray___matmul__ %__expr_-5209865760313326585 %__expr_2924140249920978521))))) (NDArray___truediv__ (NDArray_T (NDArray___truediv__ (NDArray___getitem__ (TupleNDArray___getitem__ %__expr_-7715872950595615314 %__expr_2305922367412063525) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_slice %__expr_6749312899897339687) %__expr_-8637348939342624324)))) %__expr_3134672938439589730)) (NDArray___getitem__ %__expr_-5507881356079575778 (IndexKey_slice %__expr_6749312899897339687)))) %__expr_6185990579165616281) %__expr_3300329792522185471))\n(let %__expr_-3749619018425312853 2)\n(let %__expr_-4464433185064523998 (svd (NDArray___matmul__ (NDArray_T (NDArray___mul__ (ndarray-sqrt (NDArray___mul__ (NDArray___mul__ (NDArray_scalar (Value_int %__expr_-3520630818915629594)) %__expr_-5209865760313326585) (NDArray_scalar (Value_float (Float_rational (rational %__expr_-8085216922850384227 2)))))) (NDArray_T (NDArray___sub__ %__expr_2924140249920978521 (NDArray___matmul__ %__expr_-5209865760313326585 %__expr_2924140249920978521))))) (NDArray___truediv__ (NDArray_T (NDArray___truediv__ (NDArray___getitem__ (TupleNDArray___getitem__ %__expr_-7715872950595615314 %__expr_2305922367412063525) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_slice %__expr_6749312899897339687) %__expr_-8637348939342624324)))) %__expr_3134672938439589730)) (NDArray___getitem__ %__expr_-5507881356079575778 (IndexKey_slice %__expr_6749312899897339687)))) %__expr_6185990579165616281))\n(let %__expr_8528844779137627870 (NDArray___eq__ (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of %__expr_-3520630818915629594))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (NDArray_scalar %__expr_-6765600943420531488)))\n(let %__expr_4447619498771141281 (NDArray___matmul__ %__expr_-5209865760313326585 %__expr_2924140249920978521))\n(let %__expr_-2753571644920605745 (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2))))))\n(let %__expr_3259058749987290790 (assume_dtype (NDArray_var \"y\") (DType_int64)))\n(let %__expr_-6562228218073754698 (NDArray___truediv__ (NDArray_T (NDArray___truediv__ (NDArray___getitem__ (TupleNDArray___getitem__ %__expr_-7715872950595615314 %__expr_2305922367412063525) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_slice %__expr_6749312899897339687) %__expr_-8637348939342624324)))) %__expr_3134672938439589730)) (NDArray___getitem__ %__expr_-5507881356079575778 (IndexKey_slice %__expr_6749312899897339687))))\n(let %__expr_-1580149342035447281 0)\n(sort Program)\n(function Program_compile (Program i64) Unit :default ())\n(function ndarray_function_two_program (NDArray NDArray NDArray) Program)\n(Program_compile (ndarray_function_two_program (NDArray___getitem__ (NDArray___matmul__ (NDArray___sub__ %__expr_978886785202701864 %__expr_4447619498771141281) (NDArray___matmul__ %__expr_-6562228218073754698 (NDArray___getitem__ (NDArray_T (TupleNDArray___getitem__ %__expr_-4464433185064523998 %__expr_2305922367412063525)) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of %__expr_-8637348939342624324 (MultiAxisIndexKeyItem_slice (Slice___init__ %__expr_-143818766793636568 (OptionalInt_some (Value_to_int (NDArray_to_value (sum (astype (NDArray___gt__ %__expr_2615935926139764667 (NDArray___mul__ %__expr_-4180228001421012884 (NDArray___getitem__ %__expr_2615935926139764667 %__expr_4326809257670680665))) %__expr_-3501279694271260104) %__expr_5981948135265815040)))) %__expr_-143818766793636568)))))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of %__expr_-8637348939342624324 (MultiAxisIndexKeyItem_slice (Slice___init__ %__expr_-143818766793636568 (OptionalInt_some %__expr_2305922367412063525) %__expr_-143818766793636568)))))) (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2))))))) %__expr_-1580149342035447281)\n(ruleset array_api_program_gen_ruleset)\n(function Program_function_two (Program Program Program String) Program)\n(function ndarray_program (NDArray) Program)\n(rewrite (ndarray_function_two_program res l r) (Program_function_two (ndarray_program res) (ndarray_program l) (ndarray_program r) \"__fn\") :ruleset array_api_program_gen_ruleset)\n(function Program___init__ (String bool) Program)\n(rewrite (ndarray_program (NDArray_var s)) (Program___init__ s true) :ruleset array_api_program_gen_ruleset)\n(function Program_statement (Program Program) Program :unextractable)\n(function Program___add__ (Program Program) Program)\n(function dtype_program (DType) Program)\n(rewrite (ndarray_program (assume_dtype z dtype)) (Program_statement (ndarray_program z) (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"assert \" false) (ndarray_program z)) (Program___init__ \".dtype == \" false)) (dtype_program dtype))) :ruleset array_api_program_gen_ruleset)\n(function tuple_int_program (TupleInt) Program)\n(rewrite (ndarray_program (assume_shape z ti)) (Program_statement (ndarray_program z) (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"assert \" false) (ndarray_program z)) (Program___init__ \".shape == \" false)) (tuple_int_program ti))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (assume_isfinite z)) (Program_statement (ndarray_program z) (Program___add__ (Program___add__ (Program___init__ \"assert np.all(np.isfinite(\" false) (ndarray_program z)) (Program___init__ \"))\" false))) :ruleset array_api_program_gen_ruleset)\n(function tuple_value_program (TupleValue) Program)\n(rewrite (ndarray_program (assume_value_one_of z tv)) (Program_statement (ndarray_program z) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"assert set(np.unique(\" false) (ndarray_program z)) (Program___init__ \")) == set(\" false)) (tuple_value_program tv)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(function Program_assign (Program) Program)\n(rewrite (ndarray_program (reshape y ti ob)) (Program_assign (Program___add__ (Program___add__ (Program___add__ (ndarray_program y) (Program___init__ \".reshape(\" false)) (tuple_int_program ti)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (astype y dtype)) (Program_assign (Program___add__ (Program___add__ (Program___add__ (ndarray_program y) (Program___init__ \".astype(\" false)) (dtype_program dtype)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(function tuple_ndarray_program (TupleNDArray) Program)\n(rewrite (tuple_ndarray_program (unique_counts x)) (Program_assign (Program___add__ (Program___add__ (Program___init__ \"np.unique(\" false) (ndarray_program x)) (Program___init__ \", return_counts=True)\" false))) :ruleset array_api_program_gen_ruleset)\n(rewrite (tuple_ndarray_program (unique_inverse x)) (Program_assign (Program___add__ (Program___add__ (Program___init__ \"np.unique(\" false) (ndarray_program x)) (Program___init__ \", return_inverse=True)\" false))) :ruleset array_api_program_gen_ruleset)\n(function int_program (Int) Program)\n(rewrite (ndarray_program (TupleNDArray___getitem__ tnd i)) (Program___add__ (Program___add__ (Program___add__ (tuple_ndarray_program tnd) (Program___init__ \"[\" false)) (int_program i)) (Program___init__ \"]\" false)) :ruleset array_api_program_gen_ruleset)\n(function value_program (Value) Program)\n(rewrite (ndarray_program (NDArray_scalar v)) (Program___add__ (Program___add__ (Program___init__ \"np.array(\" false) (value_program v)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (zeros ti %__expr_2091604061025500396 optional_device_)) (Program_assign (Program___add__ (Program___add__ (Program___init__ \"np.zeros(\" false) (tuple_int_program ti)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (zeros ti (OptionalDType_some dtype) optional_device_)) (Program_assign (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"np.zeros(\" false) (tuple_int_program ti)) (Program___init__ \", dtype=\" false)) (dtype_program dtype)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (unique_values x)) (Program_assign (Program___add__ (Program___add__ (Program___init__ \"np.unique(\" false) (ndarray_program x)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(function NDArray___add__ (NDArray NDArray) NDArray)\n(rewrite (ndarray_program (NDArray___add__ x y)) (Program_assign (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \" + \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (NDArray___sub__ x y)) (Program_assign (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \" - \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (NDArray___mul__ x y)) (Program_assign (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \" * \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (NDArray___truediv__ x y)) (Program_assign (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \" / \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (NDArray___lt__ x y)) (Program_assign (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \" < \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(function NDArray___le__ (NDArray NDArray) NDArray)\n(rewrite (ndarray_program (NDArray___le__ x y)) (Program_assign (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \" <= \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (NDArray___gt__ x y)) (Program_assign (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \" > \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(function NDArray___ge__ (NDArray NDArray) NDArray)\n(rewrite (ndarray_program (NDArray___ge__ x y)) (Program_assign (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \" >= \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (NDArray___eq__ x y)) (Program_assign (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \" == \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (NDArray___matmul__ x y)) (Program_assign (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \" @ \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(function NDArray___mod__ (NDArray NDArray) NDArray)\n(rewrite (ndarray_program (NDArray___mod__ x y)) (Program_assign (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \" % \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(function NDArray___and__ (NDArray NDArray) NDArray)\n(rewrite (ndarray_program (NDArray___and__ x y)) (Program_assign (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \" & \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(function NDArray___or__ (NDArray NDArray) NDArray)\n(rewrite (ndarray_program (NDArray___or__ x y)) (Program_assign (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \" | \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(function NDArray___xor__ (NDArray NDArray) NDArray)\n(rewrite (ndarray_program (NDArray___xor__ x y)) (Program_assign (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \" ^ \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(function NDArray___lshift__ (NDArray NDArray) NDArray)\n(rewrite (ndarray_program (NDArray___lshift__ x y)) (Program_assign (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \" << \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(function NDArray___rshift__ (NDArray NDArray) NDArray)\n(rewrite (ndarray_program (NDArray___rshift__ x y)) (Program_assign (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \" >> \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(function NDArray___floordiv__ (NDArray NDArray) NDArray)\n(rewrite (ndarray_program (NDArray___floordiv__ x y)) (Program_assign (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \" // \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(function NDArray___pow__ (NDArray NDArray) NDArray)\n(rewrite (ndarray_program (NDArray___pow__ x y)) (Program_assign (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \" ** \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(function index_key_program (IndexKey) Program)\n(rewrite (ndarray_program (NDArray___setitem__ x idx y)) (Program_statement (Program_assign (ndarray_program x)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program_assign (ndarray_program x)) (Program___init__ \"[\" false)) (index_key_program idx)) (Program___init__ \"] = \" false)) (ndarray_program y))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (NDArray___getitem__ x idx)) (Program___add__ (Program___add__ (Program___add__ (ndarray_program x) (Program___init__ \"[\" false)) (index_key_program idx)) (Program___init__ \"]\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (square x)) (Program_assign (Program___add__ (Program___add__ (Program___init__ \"np.square(\" false) (ndarray_program x)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (expand_dims x i)) (Program_assign (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"np.expand_dims(\" false) (ndarray_program x)) (Program___init__ \", \" false)) (int_program i)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (mean x %__expr_5981948135265815040 %__expr_6185990579165616281)) (Program_assign (Program___add__ (Program___add__ (Program___init__ \"np.mean(\" false) (ndarray_program x)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(function int_or_tuple_program (IntOrTuple) Program)\n(rewrite (ndarray_program (mean x (OptionalIntOrTuple_some int_or_tuple_) %__expr_6185990579165616281)) (Program_assign (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"np.mean(\" false) (ndarray_program x)) (Program___init__ \", axis=\" false)) (int_or_tuple_program int_or_tuple_)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (mean x (OptionalIntOrTuple_some int_or_tuple_) (TRUE))) (Program_assign (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"np.mean(\" false) (ndarray_program x)) (Program___init__ \", axis=\" false)) (int_or_tuple_program int_or_tuple_)) (Program___init__ \", keepdims=True)\" false))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (concat tnd %__expr_-143818766793636568)) (Program_assign (Program___add__ (Program___add__ (Program___init__ \"np.concatenate(\" false) (tuple_ndarray_program tnd)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (concat tnd (OptionalInt_some i))) (Program_assign (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"np.concatenate(\" false) (tuple_ndarray_program tnd)) (Program___init__ \", axis=\" false)) (int_program i)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (NDArray_vector tv)) (Program___add__ (Program___add__ (Program___init__ \"np.array(\" false) (tuple_value_program tv)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (std x %__expr_5981948135265815040)) (Program_assign (Program___add__ (Program___add__ (Program___init__ \"np.std(\" false) (ndarray_program x)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (std x (OptionalIntOrTuple_some int_or_tuple_))) (Program_assign (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"np.std(\" false) (ndarray_program x)) (Program___init__ \", axis=\" false)) (int_or_tuple_program int_or_tuple_)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(rewrite (tuple_ndarray_program (svd x (TRUE))) (Program_assign (Program___add__ (Program___add__ (Program___init__ \"np.linalg.svd(\" false) (ndarray_program x)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(rewrite (tuple_ndarray_program (svd x %__expr_6185990579165616281)) (Program_assign (Program___add__ (Program___add__ (Program___init__ \"np.linalg.svd(\" false) (ndarray_program x)) (Program___init__ \", full_matrices=False)\" false))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (ndarray-sqrt x)) (Program_assign (Program___add__ (Program___add__ (Program___init__ \"np.sqrt(\" false) (ndarray_program x)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (NDArray_T x)) (Program___add__ (ndarray_program x) (Program___init__ \".T\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (sum x (OptionalIntOrTuple_none))) (Program_assign (Program___add__ (Program___add__ (Program___init__ \"np.sum(\" false) (ndarray_program x)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (sum x (OptionalIntOrTuple_some int_or_tuple_))) (Program_assign (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"np.sum(\" false) (ndarray_program x)) (Program___init__ \", axis=\" false)) (int_or_tuple_program int_or_tuple_)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(rewrite (tuple_int_program (NDArray_shape x)) (Program___add__ (ndarray_program x) (Program___init__ \".shape\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (ndarray-abs x)) (Program_assign (Program___add__ (Program___add__ (Program___init__ \"np.abs(\" false) (ndarray_program x)) (Program___init__ \")\" false))) :ruleset array_api_program_gen_ruleset)\n(function optional_int_or_tuple_program (OptionalIntOrTuple) Program)\n(rewrite (optional_int_or_tuple_program (OptionalIntOrTuple_some it)) (int_or_tuple_program it) :ruleset array_api_program_gen_ruleset)\n(rewrite (optional_int_or_tuple_program %__expr_5981948135265815040) (Program___init__ \"None\" false) :ruleset array_api_program_gen_ruleset)\n(rewrite (int_or_tuple_program (IntOrTuple_int x)) (int_program x) :ruleset array_api_program_gen_ruleset)\n(function IntOrTuple_tuple (TupleInt) IntOrTuple)\n(rewrite (int_or_tuple_program (IntOrTuple_tuple t)) (tuple_int_program t) :ruleset array_api_program_gen_ruleset)\n(function IndexKey_ELLIPSIS () IndexKey)\n(rewrite (index_key_program (IndexKey_ELLIPSIS)) (Program___init__ \"...\" false) :ruleset array_api_program_gen_ruleset)\n(rewrite (index_key_program (IndexKey_int i)) (int_program i) :ruleset array_api_program_gen_ruleset)\n(function slice_program (Slice) Program)\n(rewrite (index_key_program (IndexKey_slice s)) (slice_program s) :ruleset array_api_program_gen_ruleset)\n(function multi_axis_index_key_program (MultiAxisIndexKey) Program)\n(rewrite (index_key_program (IndexKey_multi_axis key)) (multi_axis_index_key_program key) :ruleset array_api_program_gen_ruleset)\n(rewrite (index_key_program (IndexKey_ndarray a)) (ndarray_program a) :ruleset array_api_program_gen_ruleset)\n(sort UnstableFn_MultiAxisIndexKeyItem_Int (UnstableFn (Int) MultiAxisIndexKeyItem))\n(function idx_fn-UnstableFn_MultiAxisIndexKeyItem_Int_i-Int__unstable-app_idx_fn__Int___add___i__Int___init___1___ (UnstableFn_MultiAxisIndexKeyItem_Int Int) MultiAxisIndexKeyItem)\n(rewrite (idx_fn-UnstableFn_MultiAxisIndexKeyItem_Int_i-Int__unstable-app_idx_fn__Int___add___i__Int___init___1___ idx_fn i) (unstable-app idx_fn (Int___add__ i (Int___init__ 1))) :ruleset array_api_program_gen_ruleset)\n(function MultiAxisIndexKey___init__ (Int UnstableFn_MultiAxisIndexKeyItem_Int) MultiAxisIndexKey)\n(rewrite (multi_axis_index_key_program (MultiAxisIndexKey___init__ %__expr_-7942988945600443502 idx_fn)) (Program___init__ \"\" false) :ruleset array_api_program_gen_ruleset)\n(function multi_axis_index_key_item_program (MultiAxisIndexKeyItem) Program)\n(rewrite (multi_axis_index_key_program (MultiAxisIndexKey___init__ (Int___init__ k) idx_fn)) (Program___add__ (Program___add__ (multi_axis_index_key_item_program (unstable-app idx_fn %__expr_-7942988945600443502)) (Program___init__ \", \" false)) (multi_axis_index_key_program (MultiAxisIndexKey___init__ (Int___init__ (- k 1)) (unstable-fn \"idx_fn-UnstableFn_MultiAxisIndexKeyItem_Int_i-Int__unstable-app_idx_fn__Int___add___i__Int___init___1___\" idx_fn)))) :when ((!= k 0)) :ruleset array_api_program_gen_ruleset)\n(rewrite (multi_axis_index_key_program (MultiAxisIndexKey_from_vec (vec-of))) (Program___init__ \"\" false) :ruleset array_api_program_gen_ruleset)\n(rewrite (multi_axis_index_key_program (MultiAxisIndexKey_from_vec vec)) (Program___add__ (multi_axis_index_key_item_program (vec-get vec %__expr_-1580149342035447281)) (Program___init__ \",\" false)) :when ((= (vec-length vec) %__expr_-8085216922850384227)) :ruleset array_api_program_gen_ruleset)\n(rewrite (multi_axis_index_key_program (MultiAxisIndexKey_from_vec vec)) (Program___add__ (Program___add__ (multi_axis_index_key_item_program (vec-get vec %__expr_-1580149342035447281)) (Program___init__ \", \" false)) (multi_axis_index_key_program (MultiAxisIndexKey_from_vec (vec-remove vec %__expr_-1580149342035447281)))) :when ((> (vec-length vec) %__expr_-8085216922850384227)) :ruleset array_api_program_gen_ruleset)\n(rewrite (multi_axis_index_key_item_program (MultiAxisIndexKeyItem_int i)) (int_program i) :ruleset array_api_program_gen_ruleset)\n(rewrite (multi_axis_index_key_item_program (MultiAxisIndexKeyItem_slice s)) (slice_program s) :ruleset array_api_program_gen_ruleset)\n(function MultiAxisIndexKeyItem_ELLIPSIS () MultiAxisIndexKeyItem)\n(rewrite (multi_axis_index_key_item_program (MultiAxisIndexKeyItem_ELLIPSIS)) (Program___init__ \"...\" false) :ruleset array_api_program_gen_ruleset)\n(function MultiAxisIndexKeyItem_NONE () MultiAxisIndexKeyItem)\n(rewrite (multi_axis_index_key_item_program (MultiAxisIndexKeyItem_NONE)) (Program___init__ \"None\" false) :ruleset array_api_program_gen_ruleset)\n(function optional_int_slice_program (OptionalInt) Program)\n(rewrite (slice_program (Slice___init__ start stop %__expr_-143818766793636568)) (Program___add__ (Program___add__ (optional_int_slice_program start) (Program___init__ \":\" false)) (optional_int_slice_program stop)) :ruleset array_api_program_gen_ruleset)\n(rewrite (slice_program (Slice___init__ start stop (OptionalInt_some i))) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (optional_int_slice_program start) (Program___init__ \":\" false)) (optional_int_slice_program stop)) (Program___init__ \":\" false)) (int_program i)) :ruleset array_api_program_gen_ruleset)\n(rewrite (optional_int_slice_program %__expr_-143818766793636568) (Program___init__ \"\" false) :ruleset array_api_program_gen_ruleset)\n(rewrite (optional_int_slice_program (OptionalInt_some x)) (int_program x) :ruleset array_api_program_gen_ruleset)\n(function optional_int_program (OptionalInt) Program)\n(rewrite (optional_int_program %__expr_-143818766793636568) (Program___init__ \"None\" false) :ruleset array_api_program_gen_ruleset)\n(rewrite (optional_int_program (OptionalInt_some x)) (int_program x) :ruleset array_api_program_gen_ruleset)\n(function optional_dtype_program (OptionalDType) Program)\n(rewrite (optional_dtype_program %__expr_2091604061025500396) (Program___init__ \"None\" false) :ruleset array_api_program_gen_ruleset)\n(rewrite (optional_dtype_program (OptionalDType_some dtype)) (dtype_program dtype) :ruleset array_api_program_gen_ruleset)\n(function tuple_ndarray_program_inner (TupleNDArray) Program)\n(rewrite (tuple_ndarray_program r) (Program___add__ (Program___add__ (Program___init__ \"(\" false) (tuple_ndarray_program_inner r)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (tuple_ndarray_program_inner (TupleNDArray___init__ x)) (Program___add__ (ndarray_program x) (Program___init__ \",\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (tuple_ndarray_program_inner (TupleNDArray___add__ l r)) (Program___add__ (Program___add__ (tuple_ndarray_program_inner l) (Program___init__ \" \" false)) (tuple_ndarray_program_inner r)) :ruleset array_api_program_gen_ruleset)\n(rewrite (int_program (TupleNDArray_length l)) (Program___add__ (Program___add__ (Program___init__ \"len(\" false) (tuple_ndarray_program l)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (ndarray_program (TupleNDArray___getitem__ l i)) (Program___add__ (Program___add__ (Program___add__ (tuple_ndarray_program l) (Program___init__ \"[\" false)) (int_program i)) (Program___init__ \"]\" false)) :ruleset array_api_program_gen_ruleset)\n(function tuple_value_program_inner (TupleValue) Program)\n(rewrite (tuple_value_program tv1) (Program___add__ (Program___add__ (Program___init__ \"(\" false) (tuple_value_program_inner tv1)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (tuple_value_program_inner (TupleValue___add__ tv1 tv2)) (Program___add__ (Program___add__ (tuple_value_program_inner tv1) (Program___init__ \" \" false)) (tuple_value_program_inner tv2)) :ruleset array_api_program_gen_ruleset)\n(rewrite (tuple_value_program_inner (TupleValue___init__ v)) (Program___add__ (value_program v) (Program___init__ \",\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (value_program (Value_int i)) (int_program i) :ruleset array_api_program_gen_ruleset)\n(function bool_program (Boolean) Program)\n(rewrite (value_program (Value_bool b)) (bool_program b) :ruleset array_api_program_gen_ruleset)\n(function float_program (Float) Program)\n(rewrite (value_program (Value_float f)) (float_program f) :ruleset array_api_program_gen_ruleset)\n(rewrite (value_program (NDArray_to_value x)) (ndarray_program x) :ruleset array_api_program_gen_ruleset)\n(rewrite (value_program (Value___lt__ v1 v2)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (value_program v1)) (Program___init__ \" < \" false)) (value_program v2)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (value_program (Value___truediv__ v1 v2)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (value_program v1)) (Program___init__ \" / \" false)) (value_program v2)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (bool_program (Value_to_bool v1)) (value_program v1) :ruleset array_api_program_gen_ruleset)\n(rewrite (int_program (Value_to_int v1)) (value_program v1) :ruleset array_api_program_gen_ruleset)\n(rewrite (float_program (Float___init__ f64_)) (Program___init__ (to-string f64_) false) :ruleset array_api_program_gen_ruleset)\n(rewrite (float_program (Float_abs f)) (Program___add__ (Program___add__ (Program___init__ \"np.abs(\" false) (float_program f)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (float_program (Float_from_int i)) (int_program i) :ruleset array_api_program_gen_ruleset)\n(rewrite (float_program (Float___add__ f g)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (float_program f)) (Program___init__ \" + \" false)) (float_program g)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (float_program (Float___sub__ f g)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (float_program f)) (Program___init__ \" - \" false)) (float_program g)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (float_program (Float___mul__ f g)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (float_program f)) (Program___init__ \" * \" false)) (float_program g)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (float_program (Float___truediv__ f g)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (float_program f)) (Program___init__ \" / \" false)) (float_program g)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (float_program (Float_rational r)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"float(\" false) (Program___init__ (to-string (numer r)) false)) (Program___init__ \" / \" false)) (Program___init__ (to-string (denom r)) false)) (Program___init__ \")\" false)) :when ((!= (denom r) %__expr_-8085216922850384227)) :ruleset array_api_program_gen_ruleset)\n(rewrite (float_program (Float_rational r)) (Program___add__ (Program___add__ (Program___init__ \"float(\" false) (Program___init__ (to-string (numer r)) false)) (Program___init__ \")\" false)) :when ((= (denom r) %__expr_-8085216922850384227)) :ruleset array_api_program_gen_ruleset)\n(rewrite (dtype_program %__expr_2565664028803046192) (Program___init__ \"np.dtype(np.float64)\" false) :ruleset array_api_program_gen_ruleset)\n(rewrite (dtype_program (DType_float32)) (Program___init__ \"np.dtype(np.float32)\" false) :ruleset array_api_program_gen_ruleset)\n(rewrite (dtype_program (DType_int64)) (Program___init__ \"np.dtype(np.int64)\" false) :ruleset array_api_program_gen_ruleset)\n(rewrite (dtype_program %__expr_-3501279694271260104) (Program___init__ \"np.dtype(np.int32)\" false) :ruleset array_api_program_gen_ruleset)\n(rewrite (dtype_program (DType_bool)) (Program___init__ \"np.dtype(np.bool)\" false) :ruleset array_api_program_gen_ruleset)\n(rewrite (dtype_program (DType_object)) (Program___init__ \"np.dtype(np.object_)\" false) :ruleset array_api_program_gen_ruleset)\n(rewrite (idx_fn-UnstableFn_Int_Int_i-Int__unstable-app_idx_fn__Int___add___i__Int___init___1___ idx_fn i) (unstable-app idx_fn (Int___add__ i (Int___init__ 1))) :ruleset array_api_program_gen_ruleset)\n(rewrite (int_program (TupleInt___getitem__ ti i)) (Program___add__ (Program___add__ (Program___add__ (tuple_int_program ti) (Program___init__ \"[\" false)) (int_program i)) (Program___init__ \"]\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (int_program (TupleInt_length ti)) (Program___add__ (Program___add__ (Program___init__ \"len(\" false) (tuple_int_program ti)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(function tuple_int_program_inner (TupleInt) Program)\n(rewrite (tuple_int_program ti) (Program___add__ (Program___add__ (Program___init__ \"(\" false) (tuple_int_program_inner ti)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (tuple_int_program_inner (TupleInt___init__ (Int___init__ 0) idx_fn)) (Program___init__ \"\" false) :ruleset array_api_program_gen_ruleset)\n(rewrite (tuple_int_program_inner (TupleInt___init__ (Int___init__ k) idx_fn)) (Program___add__ (Program___add__ (int_program (unstable-app idx_fn (Int___init__ 0))) (Program___init__ \", \" false)) (tuple_int_program_inner (TupleInt___init__ (Int___init__ (- k 1)) (unstable-fn \"idx_fn-UnstableFn_Int_Int_i-Int__unstable-app_idx_fn__Int___add___i__Int___init___1___\" idx_fn)))) :when ((!= k 0)) :ruleset array_api_program_gen_ruleset)\n(rewrite (tuple_int_program_inner (TupleInt_from_vec (vec-of))) (Program___init__ \"\" false) :ruleset array_api_program_gen_ruleset)\n(rewrite (tuple_int_program_inner (TupleInt_from_vec vec_int)) (Program___add__ (Program___add__ (int_program (vec-get vec_int %__expr_-1580149342035447281)) (Program___init__ \", \" false)) (tuple_int_program_inner (TupleInt_from_vec (vec-remove vec_int %__expr_-1580149342035447281)))) :when ((> (vec-length vec_int) %__expr_-8085216922850384227)) :ruleset array_api_program_gen_ruleset)\n(rewrite (tuple_int_program_inner (TupleInt_from_vec vec_int)) (Program___add__ (int_program (vec-get vec_int %__expr_-1580149342035447281)) (Program___init__ \",\" false)) :when ((= (vec-length vec_int) %__expr_-8085216922850384227)) :ruleset array_api_program_gen_ruleset)\n(rewrite (int_program (Int___init__ i64_)) (Program___init__ (to-string i64_) false) :ruleset array_api_program_gen_ruleset)\n(rewrite (int_program (Int___invert__ i)) (Program___add__ (Program___init__ \"~\" false) (int_program i)) :ruleset array_api_program_gen_ruleset)\n(rewrite (bool_program (Int___lt__ i j)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (int_program i)) (Program___init__ \" < \" false)) (int_program j)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(function Int___le__ (Int Int) Boolean)\n(rewrite (bool_program (Int___le__ i j)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (int_program i)) (Program___init__ \" <= \" false)) (int_program j)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (bool_program (Int___gt__ i j)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (int_program i)) (Program___init__ \" > \" false)) (int_program j)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (bool_program (Int___ge__ i j)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (int_program i)) (Program___init__ \" >= \" false)) (int_program j)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (bool_program (Int___eq__ i j)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (int_program i)) (Program___init__ \" == \" false)) (int_program j)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (int_program (Int___add__ i j)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (int_program i)) (Program___init__ \" + \" false)) (int_program j)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (int_program (Int___sub__ i j)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (int_program i)) (Program___init__ \" - \" false)) (int_program j)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (int_program (Int___mul__ i j)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (int_program i)) (Program___init__ \" * \" false)) (int_program j)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (int_program (Int___truediv__ i j)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (int_program i)) (Program___init__ \" / \" false)) (int_program j)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (int_program (Int___mod__ i j)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (int_program i)) (Program___init__ \" % \" false)) (int_program j)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(function Int___pow__ (Int Int) Int)\n(rewrite (int_program (Int___pow__ i j)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (int_program i)) (Program___init__ \" ** \" false)) (int_program j)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (int_program (Int___and__ i j)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (int_program i)) (Program___init__ \" & \" false)) (int_program j)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (int_program (Int___or__ i j)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (int_program i)) (Program___init__ \" | \" false)) (int_program j)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (int_program (Int___xor__ i j)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (int_program i)) (Program___init__ \" ^ \" false)) (int_program j)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (int_program (Int___lshift__ i j)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (int_program i)) (Program___init__ \" << \" false)) (int_program j)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (int_program (Int___rshift__ i j)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (int_program i)) (Program___init__ \" >> \" false)) (int_program j)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(function Int___floordiv__ (Int Int) Int)\n(rewrite (int_program (Int___floordiv__ i j)) (Program___add__ (Program___add__ (Program___add__ (Program___add__ (Program___init__ \"(\" false) (int_program i)) (Program___init__ \" // \" false)) (int_program j)) (Program___init__ \")\" false)) :ruleset array_api_program_gen_ruleset)\n(rewrite (bool_program (TRUE)) (Program___init__ \"True\" false) :ruleset array_api_program_gen_ruleset)\n(rewrite (bool_program %__expr_6185990579165616281) (Program___init__ \"False\" false) :ruleset array_api_program_gen_ruleset)\n(ruleset program_gen_ruleset)\n(function Program_expr (Program) String)\n(function Program_statements (Program) String)\n(function Program_next_sym (Program) i64)\n(function Program_is_identifer (Program) bool)\n(rule ((= p (Program___init__ s b))\n (Program_compile p i))\n ((set (Program_expr p) s)\n (set (Program_statements p) \"\")\n (set (Program_next_sym p) i)\n (set (Program_is_identifer p) b))\n :ruleset program_gen_ruleset )\n(function Program_expr_to_statement (Program) Program)\n(rewrite (Program_statement p1 p2) (Program___add__ p1 (Program_expr_to_statement p2)) :ruleset program_gen_ruleset)\n(function Program_parent (Program) Program :unextractable :merge old)\n(rule ((= p (Program_expr_to_statement p1))\n (Program_compile p i))\n ((set (Program_parent p1) p)\n (set (Program_is_identifer p) false))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program_expr_to_statement p1))\n (Program_compile p i)\n (= (Program_parent p1) p))\n ((Program_compile p1 i))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program_expr_to_statement p1))\n (Program_compile p i)\n (!= (Program_parent p1) p)\n (= s1 (Program_expr p1)))\n ((set (Program_statements p) (+ s1 \"\n\"))\n (set (Program_next_sym p) i)\n (set (Program_expr p) \"\"))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program_expr_to_statement p1))\n (= (Program_parent p1) p)\n (= s1 (Program_expr p1))\n (= s2 (Program_statements p1))\n (= i (Program_next_sym p1)))\n ((set (Program_statements p) (+ s2 s1 \"\n\"))\n (set (Program_next_sym p) i)\n (set (Program_expr p) \"\"))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program___add__ p1 p2))\n (= (Program_expr p) (Program_expr p1))\n (= b (Program_is_identifer p1)))\n ((set (Program_is_identifer p) b))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program___add__ p1 p2))\n (= (Program_expr p) (Program_expr p2))\n (= b (Program_is_identifer p2)))\n ((set (Program_is_identifer p) b))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program___add__ p1 p2))\n (!= (Program_expr p) (Program_expr p1))\n (!= (Program_expr p) (Program_expr p2)))\n ((set (Program_is_identifer p) false))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program___add__ p1 p2))\n (Program_compile p i))\n ((set (Program_parent p1) p))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program___add__ p1 p2))\n (Program_compile p i)\n (= (Program_parent p1) p))\n ((Program_compile p1 i))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program___add__ p1 p2))\n (Program_compile p i)\n (Program_next_sym p1))\n ((set (Program_parent p2) p))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program___add__ p1 p2))\n (Program_compile p i)\n (!= (Program_parent p1) p)\n (= (Program_parent p2) p))\n ((Program_compile p2 i))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program___add__ p1 p2))\n (Program_compile p i2)\n (= (Program_parent p1) p)\n (= i (Program_next_sym p1))\n (= (Program_parent p2) p))\n ((Program_compile p2 i))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program___add__ p1 p2))\n (= s1 (Program_expr p1))\n (= s2 (Program_expr p2)))\n ((set (Program_expr p) (+ s1 s2)))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program___add__ p1 p2))\n (= (Program_parent p1) p)\n (= (Program_parent p2) p)\n (= s1 (Program_statements p1))\n (= s2 (Program_statements p2))\n (= i (Program_next_sym p2)))\n ((set (Program_statements p) (+ s1 s2))\n (set (Program_next_sym p) i))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program___add__ p1 p2))\n (Program_compile p i)\n (!= (Program_parent p1) p)\n (!= (Program_parent p2) p))\n ((set (Program_statements p) \"\")\n (set (Program_next_sym p) i))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program___add__ p1 p2))\n (= (Program_parent p1) p)\n (!= (Program_parent p2) p)\n (= s1 (Program_statements p1))\n (= i (Program_next_sym p1)))\n ((set (Program_statements p) s1)\n (set (Program_next_sym p) i))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program___add__ p1 p2))\n (= (Program_parent p2) p)\n (!= (Program_parent p1) p)\n (= s2 (Program_statements p2))\n (= i (Program_next_sym p2)))\n ((set (Program_statements p) s2)\n (set (Program_next_sym p) i))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program_assign p1))\n (Program_compile p i))\n ((set (Program_parent p1) p)\n (set (Program_is_identifer p) true))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program_assign p1))\n (Program_compile p i)\n (= (Program_parent p1) p))\n ((Program_compile p1 i))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program_assign p1))\n (= (Program_parent p1) p)\n (= s1 (Program_statements p1))\n (= i (Program_next_sym p1))\n (= s2 (Program_expr p1))\n (= (Program_is_identifer p1) false))\n ((set (Program_statements p) (+ s1 (+ \"_\" (to-string i)) \" = \" s2 \"\n\"))\n (set (Program_expr p) (+ \"_\" (to-string i)))\n (set (Program_next_sym p) (+ i %__expr_-8085216922850384227)))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program_assign p1))\n (!= (Program_parent p1) p)\n (Program_compile p i)\n (= s2 (Program_expr p1))\n (= (Program_is_identifer p1) false))\n ((set (Program_statements p) (+ (+ \"_\" (to-string i)) \" = \" s2 \"\n\"))\n (set (Program_expr p) (+ \"_\" (to-string i)))\n (set (Program_next_sym p) (+ i %__expr_-8085216922850384227)))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program_assign p1))\n (= (Program_parent p1) p)\n (= s1 (Program_statements p1))\n (= i (Program_next_sym p1))\n (= s2 (Program_expr p1))\n (= (Program_is_identifer p1) true))\n ((set (Program_statements p) s1)\n (set (Program_expr p) s2)\n (set (Program_next_sym p) i))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program_assign p1))\n (!= (Program_parent p1) p)\n (Program_compile p i)\n (= s2 (Program_expr p1))\n (= (Program_is_identifer p1) true))\n ((set (Program_statements p) \"\")\n (set (Program_expr p) s2)\n (set (Program_next_sym p) i))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program_function_two p1 p2 p3 s1))\n (Program_compile p i))\n ((set (Program_parent p2) p)\n (set (Program_parent p3) p)\n (set (Program_parent p1) p)\n (Program_compile p2 i)\n (Program_compile p3 i)\n (Program_compile p1 i)\n (set (Program_is_identifer p) true))\n :ruleset program_gen_ruleset )\n(rule ((= p (Program_function_two p1 p2 p3 s1))\n (Program_compile p i)\n (= s2 (Program_expr p1))\n (= s3 (Program_statements p1))\n (= s4 (Program_expr p2))\n (= s5 (Program_expr p3)))\n ((set (Program_statements p) (+ \"def \" s1 \"(\" s4 \", \" s5 \"):\n \" (replace s3 \"\n\" \"\n \") \"return \" s2 \"\n\"))\n (set (Program_next_sym p) i)\n (set (Program_expr p) s1))\n :ruleset program_gen_ruleset )\n(run-schedule (seq (saturate (run array_api_program_gen_ruleset)) (saturate (run program_gen_ruleset))))\n(let %__expr_-116196252424162806 (assume_dtype (NDArray_var \"X\") (DType_float64)))\n(extract (Program_statements (ndarray_function_two_program (NDArray___getitem__ (NDArray___matmul__ (NDArray___sub__ %__expr_978886785202701864 %__expr_4447619498771141281) (NDArray___matmul__ %__expr_-6562228218073754698 (NDArray___getitem__ (NDArray_T (TupleNDArray___getitem__ %__expr_-4464433185064523998 %__expr_2305922367412063525)) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of %__expr_-8637348939342624324 (MultiAxisIndexKeyItem_slice (Slice___init__ %__expr_-143818766793636568 (OptionalInt_some (Value_to_int (NDArray_to_value (sum (astype (NDArray___gt__ %__expr_2615935926139764667 (NDArray___mul__ %__expr_-4180228001421012884 (NDArray___getitem__ %__expr_2615935926139764667 %__expr_4326809257670680665))) %__expr_-3501279694271260104) %__expr_5981948135265815040)))) %__expr_-143818766793636568)))))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of %__expr_-8637348939342624324 (MultiAxisIndexKeyItem_slice (Slice___init__ %__expr_-143818766793636568 (OptionalInt_some %__expr_2305922367412063525) %__expr_-143818766793636568)))))) (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))))) 0)\n", + "rational": "; Test that can run rule matching on rational\n\n(datatype Pretty\n (pretty-str String)\n (pretty-rational Rational))\n\n; This will fail with `Unbound variable x in primitive computation` currently:\n; (rewrite (pretty-rational (rational x y)) (pretty-str (+ (to-string x) \"/\" (to-string y))))\n\n(rewrite (pretty-rational r) (pretty-str (+ (to-string (numer r)) \"/\" (to-string (denom r)))))\n\n(let z (pretty-rational (rational 1 2)))\n(run 1)\n(check (= z (pretty-str \"1/2\")))\n", + "resolution": "; Resolution theorem proving\n; \n; Traditional resolution theorem provers maintain a clause database\n; of formulas in Conjunction Normal Form (CNF a big And of Ors).\n; Each clause is a set of positive and negative literals\n; The prover saturates this set by taking two clauses \n; {a}\\/c1 {not a}\\/c2 and creating a new clause c1 \\/ c2.\n; Clauses also are pruned by simplications, unit propagation,\n; and subsumption.\n; These systems use sophisticated term indexing to find matching clauses\n\n; A natural question is whether egglog's saturation and term indexing gives\n; a leg up towards building one of these systems. A programmable one even,\n; with built in support for equality reasoning\n\n; Resolution is provided by a join\n; unit propagation is an equation solving process and egraph substitution\n; Clause Simplification is provided by rewrite rules\n\n; This encoding seems about right but is unsatisfying\n; Using AC to encode the set nature of clauses is inefficient\n\n; An important aspect of these provers that seems challenging to encode shallowly\n; is that the match also occurs modulo _unification_.\n; The unification variables of each clause are not globally scoped, really\n; they are scoped outside the body of each clase in an implicit \\forall\n; This encoding as it stands really only supports ground atoms modulo equality\n\n(datatype Bool)\n(function TrueConst () Bool)\n(let True (TrueConst))\n(function FalseConst () Bool)\n(let False (FalseConst))\n(function myor (Bool Bool) Bool)\n(function negate (Bool) Bool)\n\n; clauses are assumed in the normal form (or a (or b (or c False)))\n\n(union (negate False) True)\n(union (negate True) False)\n\n; \"Solving\" negation equations\n(rule ((= (negate p) True)) ((union p False)))\n(rule ((= (negate p) False)) ((union p True)))\n\n; canonicalize associtivity. \"append\" for clauses\n; terminate with false\n(rewrite (myor (myor a b) c) (myor a (myor b c)))\n; commutativity\n(rewrite (myor a (myor b c)) (myor b (myor a c)))\n\n;absorption\n(rewrite (myor a (myor a b)) (myor a b))\n(rewrite (myor a (myor (negate a) b)) True)\n\n; simplification\n(rewrite (myor False a) a)\n(rewrite (myor a False) a)\n(rewrite (myor True a) True)\n(rewrite (myor a True) True)\n\n; unit propagation\n; This is kind of interesting actually.\n; Looks a bit like equation solving\n\n; The following is not valid egglog but could be?\n;(rewrite p True \n; :when ((= True (or p False))))\n\n(rule ((= True (myor p False))) ((union p True)))\n\n; resolution\n; This counts on commutativity to bubble everything possible up to the front of the clause.\n(rule ((= True (myor a as)) (= True (myor (negate a) bs)))\n ((union (myor as bs) True)))\n\n; example predicate\n(function p (i64) Bool)\n(let p0 (p 0))\n(let p1 (p 1))\n(let p2 (p 2))\n;(union (or p0 (or p1 (or p2 False))) True)\n;(union (or (negate p0) (or p1 (or (negate p2) False))) True)\n(union (myor p1 (myor (negate p2) False)) True)\n(union (myor p2 (myor (negate p0) False)) True)\n(union (myor p0 (myor (negate p1) False)) True)\n(union p1 False)\n(union (myor (negate p0) (myor p1 (myor p2 False))) True)\n(run 10)\n\n\n(check (!= True False))\n(check (= p0 False))\n(check (= p2 False))\n\n; we could turn the original axioms into _patterns_ in all possible directions.\n; Which is kind of compelling\n; (rule ((or (pat x))) )\n; or let a unification expansion happen and use thos\n\n\n", + "rw-analysis": ";;;;;;;;;;;;;;;;\n;; Abstact Domain\n;;;;;;;;;;;;;;;;\n\n; Top means it can be an arbitrary value\n(datatype Val (I i64))\n(function TopConst () Val)\n(let Top (TopConst))\n(function TrueConst () Val)\n(let True (TrueConst))\n(function FalseConst () Val)\n(let False (FalseConst))\n(relation Bool (Val))\n(Bool True)\n(Bool False)\n\n(function merge-val (Val Val) Val)\n\n(rewrite (merge-val Top x) Top)\n(rewrite (merge-val x Top) Top)\n(rewrite (merge-val True False) Top)\n(rewrite (merge-val True (I x)) Top)\n(rewrite (merge-val False True) Top)\n(rewrite (merge-val False (I x)) Top)\n(rewrite (merge-val (I x) (I y)) Top :when ((!= x y)))\n(rewrite (merge-val x x) x)\n\n(function add-val (Val Val) Val)\n\n(rewrite (add-val Top x) Top)\n(rewrite (add-val x Top) Top)\n(rewrite (add-val True x) Top)\n(rewrite (add-val False x) Top)\n(rewrite (add-val x True) Top)\n(rewrite (add-val x False) Top)\n(rewrite (add-val (I x) (I y)) (I (+ x y)))\n\n(function eq-val (Val Val) Val)\n\n(rewrite (eq-val Top x) Top)\n(rewrite (eq-val x Top) Top)\n(rewrite (eq-val True False) False)\n(rewrite (eq-val True (I x)) False)\n(rewrite (eq-val False True) False)\n(rewrite (eq-val False (I x)) False)\n(rewrite (eq-val (I x) True) False)\n(rewrite (eq-val (I x) False) False)\n(rewrite (eq-val x x) True)\n\n(datatype VarT (V String))\n(datatype Loc (L i64))\n(datatype Exp\n (Add VarT VarT)\n (Eq VarT VarT)\n (Var VarT)\n (Const Val))\n(datatype ProgStmt\n (Ass VarT Exp)\n (If VarT Loc Loc)\n (Goto Loc)\n (Call VarT))\n(function EndConst () ProgStmt)\n(let End (EndConst))\n(function Prog (Loc) ProgStmt)\n(relation RProg (Loc ProgStmt))\n\n(function const-prop (Loc VarT) Val :merge (merge-val old new))\n\n;;;;;;;;;;;;;;;;\n;; ASS Case\n;;;;;;;;;;;;;;;;\n\n;; PROPAGATION\n\n; propagate x = k\n(rule (\n (RProg (L li) (Ass x (Const k)))\n)(\n (set (const-prop (L (+ li 1)) x) k)\n))\n\n; propagate x = a + b (non-constant)\n(rule (\n (RProg l (Ass x (Add x1 x2)))\n (= v1 (const-prop l x1))\n (= v2 (const-prop l x2))\n (= l (L li))\n)(\n (set (const-prop (L (+ li 1)) x) (add-val v1 v2))\n))\n\n; propagate x = a == b\n(rule (\n (RProg l (Ass x (Eq x1 x2)))\n (= v1 (const-prop l x1))\n (= v2 (const-prop l x2))\n (= l (L li))\n)(\n (set (const-prop (L (+ li 1)) x) (eq-val v1 v2))\n))\n\n; propagate other vars\n(rule (\n (RProg (L li) (Ass (V x) e))\n (= val (const-prop (L li) (V y)))\n (!= x y)\n)(\n (set (const-prop (L (+ li 1)) (V y)) val)\n))\n\n;; TRANSFORMATION \n\n; generate demand for biop\n(rule (\n (= (Prog l) (Ass x (Add x1 x2)))\n (= v1 (const-prop l x1))\n (= v2 (const-prop l x2))\n)(\n (add-val v1 v2)\n))\n\n(rule (\n (= (Prog l) (Ass x (Eq x1 x2)))\n (= v1 (const-prop l x1))\n (= v2 (const-prop l x2))\n)(\n (eq-val v1 v2)\n))\n\n; replace x = a + b (constant)\n(rule (\n (= (Prog l) (Ass x (Add x1 x2)))\n (= (I val) (add-val (const-prop l x1)\n (const-prop l x2)))\n)(\n (RProg l (Ass x (Const (I val))))\n))\n\n; replace x = a + b (non-contant)\n(rule (\n (= (Prog l) (Ass x (Add x1 x2)))\n (= Top (add-val (const-prop l x1)\n (const-prop l x2)))\n)(\n (RProg l (Ass x (Add x1 x2)))\n))\n\n; replace x = a == b (constant)\n(rule (\n (= (Prog l) (Ass x (Eq x1 x2)))\n (= b (eq-val (const-prop l x1) (const-prop l x2)))\n (Bool b)\n)(\n (RProg l (Ass x (Const b)))\n))\n\n; replace x = a == b (non-constant)\n(rule (\n (= (Prog l) (Ass x (Eq x1 x2)))\n (= Top (eq-val (const-prop l x1) (const-prop l x2)))\n)(\n (RProg l (Ass x (Eq x1 x2)))\n))\n\n; replace x = k\n(rule (\n (= (Prog l) (Ass x (Const val)))\n)(\n (RProg l (Ass x (Const val)))\n))\n\n;;;;;;;;;;;;;;;;\n;; CALL CASE\n;;;;;;;;;;;;;;;;\n\n;; PROPAGATION\n(rule (\n (RProg l (Call f))\n (= val (const-prop l x))\n (= l (L li))\n)(\n (set (const-prop (L (+ li 1)) x) val)\n))\n\n;; TRANSFORMATION\n(rule (\n (= (Prog l) (Call f))\n)(\n (RProg l (Call f))\n))\n\n;;;;;;;;;;;;;;;;\n;; IF CASE\n;;;;;;;;;;;;;;;;\n\n;; PROPAGATION\n(rule (\n (RProg l (If b l1 l2))\n (= val (const-prop l x))\n)(\n (set (const-prop l1 x) val)\n (set (const-prop l2 x) val)\n))\n\n;; TRANSFORMATION\n\n; replace if true\n(rule (\n (= (Prog l) (If b l1 l2))\n (= True (const-prop l b))\n)(\n (RProg l (Goto l1))\n))\n\n; replace if false\n(rule (\n (= (Prog l) (If b l1 l2))\n (= False (const-prop l b))\n)(\n (RProg l (Goto l2))\n))\n\n; replace if Top\n(rule (\n (= (Prog l) (If b l1 l2))\n (= Top (const-prop l b))\n)(\n (RProg l (If b l1 l2))\n))\n\n;;;;;;;;;;;;;;;;\n;; GOTO CASE\n;;;;;;;;;;;;;;;;\n\n;; PROPAGATION\n(rule (\n (RProg l1 (Goto l2))\n (= val (const-prop l1 x))\n)(\n (set (const-prop l2 x) val)\n))\n\n;; TRANSFORMATION\n(rule (\n (= (Prog l1) (Goto l2))\n)(\n (RProg l1 (Goto l2))\n))\n\n;;;;;;;;;;;;;;;;\n;; TEST\n;;;;;;;;;;;;;;;;\n\n(union (Prog (L 0)) (Ass (V \"b\") (Const Top)))\n(union (Prog (L 1)) (Ass (V \"ten\") (Const (I 10))))\n(union (Prog (L 2)) (Ass (V \"one\") (Const (I 1))))\n(union (Prog (L 3)) (Ass (V \"zero\") (Const (I 0))))\n; x := 10\n(union (Prog (L 4)) (Ass (V \"x\") (Const (I 10))))\n; while (...) {\n(union (Prog (L 5)) (If (V \"b\") (L 6) (L 13)))\n; if (x == 10) {\n(union (Prog (L 6)) (Ass (V \"cond\") (Eq (V \"x\") (V \"ten\"))))\n(union (Prog (L 7)) (If (V \"cond\") (L 8) (L 10)))\n; DoSomething();\n(union (Prog (L 8)) (Call (V \"DoSomething\")))\n; }\n(union (Prog (L 9)) (Goto (L 12)))\n; else {\n; DoSomething();\n(union (Prog (L 10)) (Call (V \"DoSomethingElse\")))\n; x := x + 1;\n(union (Prog (L 11)) (Ass (V \"x\") (Add (V \"x\") (V \"one\"))))\n;; (union (Prog (L 11)) (Call (V \"DoSomethingElse\")))\n; }\n(union (Prog (L 12)) (Goto (L 5)))\n; y := x\n(union (Prog (L 13)) (Ass (V \"y\") (Add (V \"x\") (V \"zero\"))))\n(union (Prog (L 14)) End)\n\n(run 20)\n\n(check (= (const-prop (L 14) (V \"y\")) (I 10)))\n\n", + "schedule-demo": "; Step with alternating feet, left before right\n(relation left (i64))\n(relation right (i64))\n\n(left 0)\n(right 0)\n\n(ruleset step-left)\n(rule ((left x) (right x))\n ((left (+ x 1)))\n :ruleset step-left)\n\n(ruleset step-right)\n(rule ((left x) (right y) (= x (+ y 1)))\n ((right x))\n :ruleset step-right)\n\n(run-schedule\n (repeat 10\n (saturate step-right)\n (saturate step-left)))\n\n; We took 10 steps with the left, but the right couldn't go the first round,\n; so we took only 9 steps with the right.\n(check (left 10))\n(check (right 9))\n(fail (check (left 11)))\n(fail (check (right 10)))\n", + "semi_naive_set_function": ";; From issue#93. The change happened in right-hand-side of a rule may also impact output in semi-naive cases\n(push)\n(function f (i64) i64 :merge (max old new))\n\n(set (f 0) 0)\n(set (f 3) 0)\n\n(rule ((= f0 (f 0))) ((set (f 1) f0)))\n(rule ((= f1 (f 1))) ((set (f 2) f1)))\n\n;; update f3 some iters later to make sure f(0) is inactive\n(rule ((= f2 (f 2))) ((set (f 3) 3)))\n\n(push)\n\n;; This rule should fire and set f(0) to be 3, but because f0 is inactive, \n;; it does not fire (despite that f3 is active now)\n(rule ((= f0 (f 0))) ((set (f 0) (f 3))))\n\n(run 100)\n(print-function f 100) ;; f0 is expected to have value 3, but has 0 in reality.\n\n(check (= (f 0) 3))\n(check (= (f 1) 3))\n(check (= (f 2) 3))\n(check (= (f 3) 3))\n\n(pop)\n(push)\n\n;; variants of the last rule.\n(rule ((= f0 (f 0)) (= x 3) (= y x)) ((set (f 0) (f y))))\n\n(run 100)\n(check (= (f 0) 3))\n(check (= (f 1) 3))\n(check (= (f 2) 3))\n(check (= (f 3) 3))\n\n(pop)\n(push)\n\n;; adding let binding\n(rule ((= f0 (f 0))) ((let x 3) (let y x) (set (f 0) (f y))))\n\n(run 100)\n(check (= (f 0) 3))\n(check (= (f 1) 3))\n(check (= (f 2) 3))\n(check (= (f 3) 3))\n\n(pop)\n(push)\n\n(function g (i64) i64 :merge (max old new))\n(set (g 0) 3)\n\n;; bind to another function\n(rule ((= f0 (f 0))) ((let x (g 0)) (let y x) (set (f 0) (f y))))\n\n(run 100)\n(check (= (f 0) 3))\n(check (= (f 1) 3))\n(check (= (f 2) 3))\n(check (= (f 3) 3))\n\n(pop)\n(pop)\n\n;; more complicated case, when the evaluation never finish\n;; the semi_naive and naive behavior diverage a bit\n(function f (i64) i64 :merge (max old new))\n\n(set (f 0) 0)\n(set (f 3) 0)\n\n(rule ((= f0 (f 0))) ((set (f 1) (+ 1 f0))))\n(rule ((= f1 (f 1))) ((set (f 2) (+ 1 f1))))\n\n(push)\n\n(rule ((= f2 (f 2))) ((set (f 3) 1)))\n(rule ((= f0 (f 0))) ((set (f 0) (f (f 3)))))\n\n\n(run 100)\n(print-function f 100) \n(check (!= 0 (f 0)))\n(check (!= 0 (f 1)))\n(check (!= 0 (f 2)))\n\n(pop)\n\n\n;; id function that will set all int values, but need strong induction.\n(function g (i64) i64 :merge (max old new))\n(set (g 0) 0)\n(set (g 1) 1)\n(rule ((= x (g x)) (= y (g (- x 1)))) ((set (g (+ x 1)) (+ y 2))))\n\n(run 100)\n(print-function g 100) \n\n(check (= 20 (g 20)))", + "set": "(sort ISetBase (Set i64))\n\n; Test set-of\n(check (= (set-of 1 2) (set-insert (set-insert (set-empty) 1) 2)))\n(check (= (set-of 1 2) (set-insert (set-insert (set-empty) 2) 1)))\n\n; Test set-union\n(check (= (set-union (set-of 1 2) (set-of 3 4)) (set-of 1 2 3 4)))\n\n; Test set-length\n(check (= 0 (set-length (set-empty))))\n(check (= 1 (set-length (set-of 1 1 1))))\n(check (= 2 (set-length (set-of 1 -1 1 1))))\n\n; Test set-get\n(check (= 1 (set-get (set-of 1 -1 2 4 1) 0)))\n(check (= 2 (set-get (set-of 1 -1 2 4 1) 1)))\n(check (= 4 (set-get (set-of 1 -1 2 4 1) 2)))\n(check (= -1 (set-get (set-of 1 -1 2 4 1) 3)))\n\n; Test set-remove\n(check (= (set-remove (set-of 1 2 3) 3) (set-of 1 2)))\n\n; Reify set\n(sort ISet)\n(function IS (ISetBase) ISet)\n\n(function ISet-get (ISet i64) i64 :unextractable)\n(rule ((IS x) (> (set-length x) 0))\n ((set (ISet-get (IS x) 0) (set-get x 0))))\n(rule ((ISet-get (IS x) j)\n (= i (+ j 1)) (< i (set-length x)))\n ((set (ISet-get (IS x) i) (set-get x i))))\n\n(let myset (IS (set-of 2 4 1 4 -1)))\n(run 100)\n(check (= 1 (ISet-get myset 0)))\n(check (= 2 (ISet-get myset 1)))\n(check (= 4 (ISet-get myset 2)))\n(check (= -1 (ISet-get myset 3)))\n", + "stratified": "(relation path (i64 i64))\n(relation edge (i64 i64))\n\n(rule ((edge x y))\n ((path x y)))\n\n(edge 1 2)\n(edge 2 3)\n(edge 3 4)\n(check (edge 1 2))\n(run 3)\n(check (path 1 2))\n\n(ruleset path-rules)\n\n(rule ((path x y) (edge y z))\n ((path x z))\n :ruleset path-rules)\n\n(edge 3 8)\n(run path-rules 1)\n(check (path 1 3))\n\n\n\n; Should fail\n; (check (path 1 4))\n; (check (path 3 8)) \n", + "stresstest_large_expr": ";; Old version of python array optimization that does not include CSE with let statements\n;; serves as a benchmark for adding large expressions to egglog\n(ruleset array_api_ruleset)\n(sort Int)\n(function cast_Callable__Int__Int___Int___lambda_i_____i_ (Int Int) Int)\n(rewrite (cast_Callable__Int__Int___Int___lambda_i_____i_ __var__i __var___) __var__i :ruleset array_api_ruleset)\n(sort TupleInt)\n(function TupleInt_single (Int) TupleInt)\n(sort UnstableFn_Int_Int (UnstableFn (Int) Int))\n(function TupleInt___init__ (Int UnstableFn_Int_Int) TupleInt)\n(function Int___init__ (i64) Int)\n(rewrite (TupleInt_single __var__i) (TupleInt___init__ (Int___init__ 1) (unstable-fn \"cast_Callable__Int__Int___Int___lambda_i_____i_\" __var__i)) :ruleset array_api_ruleset)\n(function cast_Callable__Int___Int___lambda_i__i_ (Int) Int)\n(rewrite (cast_Callable__Int___Int___lambda_i__i_ __var__i) __var__i :ruleset array_api_ruleset)\n(function TupleInt_range (Int) TupleInt)\n(rewrite (TupleInt_range __var__stop) (TupleInt___init__ __var__stop (unstable-fn \"cast_Callable__Int___Int___lambda_i__i_\")) :ruleset array_api_ruleset)\n(sort Vec_Int (Vec Int))\n(function TupleInt_from_vec (Vec_Int) TupleInt)\n(function index_vec_int (Vec_Int Int) Int)\n(rewrite (TupleInt_from_vec __var__vec) (TupleInt___init__ (Int___init__ (vec-length __var__vec)) (unstable-fn \"index_vec_int\" __var__vec)) :ruleset array_api_ruleset)\n(function cast_Callable__TupleInt__TupleInt__Int___Int___lambda_other__self__i__Int_if__i_<_self_length____self_i___other_i_-_self_length_____ (TupleInt TupleInt Int) Int)\n(sort Boolean)\n(function Int_if_ (Boolean Int Int) Int)\n(function Int___lt__ (Int Int) Boolean)\n(function TupleInt_length (TupleInt) Int)\n(function TupleInt___getitem__ (TupleInt Int) Int)\n(function Int___sub__ (Int Int) Int)\n(rewrite (cast_Callable__TupleInt__TupleInt__Int___Int___lambda_other__self__i__Int_if__i_<_self_length____self_i___other_i_-_self_length_____ __var__other __var__self __var__i) (Int_if_ (Int___lt__ __var__i (TupleInt_length __var__self)) (TupleInt___getitem__ __var__self __var__i) (TupleInt___getitem__ __var__other (Int___sub__ __var__i (TupleInt_length __var__self)))) :ruleset array_api_ruleset)\n(function TupleInt___add__ (TupleInt TupleInt) TupleInt)\n(function Int___add__ (Int Int) Int)\n(rewrite (TupleInt___add__ __var__self __var__other) (TupleInt___init__ (Int___add__ (TupleInt_length __var__self) (TupleInt_length __var__other)) (unstable-fn \"cast_Callable__TupleInt__TupleInt__Int___Int___lambda_other__self__i__Int_if__i_<_self_length____self_i___other_i_-_self_length_____\" __var__other __var__self)) :ruleset array_api_ruleset)\n(function cast_Callable__Int__Boolean__Int___Boolean___lambda_i__acc__j__acc_|__i_==_j__ (Int Boolean Int) Boolean)\n(function Boolean___or__ (Boolean Boolean) Boolean)\n(function Int___eq__ (Int Int) Boolean)\n(rewrite (cast_Callable__Int__Boolean__Int___Boolean___lambda_i__acc__j__acc_|__i_==_j__ __var__i __var__acc __var__j) (Boolean___or__ __var__acc (Int___eq__ __var__i __var__j)) :ruleset array_api_ruleset)\n(function TupleInt_contains (TupleInt Int) Boolean)\n(sort UnstableFn_Boolean_Boolean_Int (UnstableFn (Boolean Int) Boolean))\n(function TupleInt_fold_boolean (TupleInt Boolean UnstableFn_Boolean_Boolean_Int) Boolean)\n(function FALSE () Boolean)\n(rewrite (TupleInt_contains __var__self __var__i) (TupleInt_fold_boolean __var__self (FALSE) (unstable-fn \"cast_Callable__Int__Boolean__Int___Boolean___lambda_i__acc__j__acc_|__i_==_j__\" __var__i)) :ruleset array_api_ruleset)\n(sort NDArray)\n(function NDArray_size (NDArray) Int)\n(sort UnstableFn_Int_Int_Int (UnstableFn (Int Int) Int))\n(function TupleInt_fold (TupleInt Int UnstableFn_Int_Int_Int) Int)\n(function NDArray_shape (NDArray) TupleInt)\n(function Int___mul__ (Int Int) Int)\n(rewrite (NDArray_size __var__x) (TupleInt_fold (NDArray_shape __var__x) (Int___init__ 1) (unstable-fn \"Int___mul__\")) :ruleset array_api_ruleset)\n(function unique_values (NDArray) NDArray)\n(sort TupleValue)\n(function NDArray_vector (TupleValue) NDArray)\n(sort Value)\n(function possible_values (Value) TupleValue)\n(function NDArray_index (NDArray TupleInt) Value)\n(function ALL_INDICES () TupleInt)\n(rewrite (unique_values __var__a) (NDArray_vector (possible_values (NDArray_index __var__a (ALL_INDICES)))) :ruleset array_api_ruleset)\n(function Value_isfinite (Value) Boolean)\n(function Value_int (Int) Value)\n(function TRUE () Boolean)\n(rewrite (Value_isfinite (Value_int __var__i)) (TRUE) :ruleset array_api_ruleset)\n(function Value_bool (Boolean) Value)\n(rewrite (Value_isfinite (Value_bool __var__b)) (TRUE) :ruleset array_api_ruleset)\n(sort Float)\n(function Value_float (Float) Value)\n(function Float___init__ (f64) Float :cost 3)\n(rewrite (Value_isfinite (Value_float (Float___init__ __var__f))) (TRUE) :when ((!= __var__f NaN)) :ruleset array_api_ruleset)\n(function isfinite (NDArray) NDArray)\n(sort OptionalIntOrTuple)\n(function sum (NDArray OptionalIntOrTuple) NDArray)\n(function OptionalIntOrTuple_none () OptionalIntOrTuple)\n(function NDArray_scalar (Value) NDArray)\n(rewrite (isfinite (sum __var__arr (OptionalIntOrTuple_none))) (NDArray_scalar (Value_bool (Value_isfinite (NDArray_index __var__arr (ALL_INDICES))))) :ruleset array_api_ruleset)\n(function assume_value_one_of (NDArray TupleValue) NDArray)\n(rewrite (NDArray_shape (assume_value_one_of __var__x __var__vs)) (NDArray_shape __var__x) :ruleset array_api_ruleset)\n(sort DType)\n(function NDArray_dtype (NDArray) DType)\n(rewrite (NDArray_dtype (assume_value_one_of __var__x __var__vs)) (NDArray_dtype __var__x) :ruleset array_api_ruleset)\n(rule ((= __var__v (NDArray_index (assume_value_one_of __var__x __var__vs) __var__idx)))\n ((union __var__v (NDArray_index __var__x __var__idx))\n (union (possible_values __var__v) __var__vs))\n :ruleset array_api_ruleset )\n(function assume_isfinite (NDArray) NDArray)\n(rewrite (NDArray_shape (assume_isfinite __var__x)) (NDArray_shape __var__x) :ruleset array_api_ruleset)\n(rewrite (NDArray_dtype (assume_isfinite __var__x)) (NDArray_dtype __var__x) :ruleset array_api_ruleset)\n(rewrite (NDArray_index (assume_isfinite __var__x) __var__ti) (NDArray_index __var__x __var__ti) :ruleset array_api_ruleset)\n(rewrite (Value_isfinite (NDArray_index (assume_isfinite __var__x) __var__ti)) (TRUE) :ruleset array_api_ruleset)\n(function assume_shape (NDArray TupleInt) NDArray)\n(rewrite (NDArray_shape (assume_shape __var__x __var__shape)) __var__shape :ruleset array_api_ruleset)\n(rewrite (NDArray_dtype (assume_shape __var__x __var__shape)) (NDArray_dtype __var__x) :ruleset array_api_ruleset)\n(rewrite (NDArray_index (assume_shape __var__x __var__shape) __var__idx) (NDArray_index __var__x __var__idx) :ruleset array_api_ruleset)\n(function assume_dtype (NDArray DType) NDArray)\n(rewrite (NDArray_dtype (assume_dtype __var__x __var__dtype)) __var__dtype :ruleset array_api_ruleset)\n(rewrite (NDArray_shape (assume_dtype __var__x __var__dtype)) (NDArray_shape __var__x) :ruleset array_api_ruleset)\n(rewrite (NDArray_index (assume_dtype __var__x __var__dtype) __var__idx) (NDArray_index __var__x __var__idx) :ruleset array_api_ruleset)\n(sort IndexKey)\n(function NDArray___getitem__ (NDArray IndexKey) NDArray)\n(function IndexKey_int (Int) IndexKey)\n(rewrite (NDArray___getitem__ __var__x (IndexKey_int __var__i)) (NDArray_scalar (NDArray_index __var__x (TupleInt_single __var__i))) :ruleset array_api_ruleset)\n(sort OptionalBool)\n(function reshape (NDArray TupleInt OptionalBool) NDArray)\n(rule ((= __a (reshape __var__x __var__shape __var__copy)))\n ((NDArray_shape __var__x)\n (TupleInt_length (NDArray_shape __var__x)))\n :ruleset array_api_ruleset )\n(rule ((reshape __var__x __var__shape __var__copy))\n ((TupleInt_length __var__shape)\n (TupleInt___getitem__ __var__shape (Int___init__ 0)))\n :ruleset array_api_ruleset )\n(rewrite (reshape __var__x __var__shape __var__copy) __var__x :when ((= (TupleInt_length (NDArray_shape __var__x)) (Int___init__ 1)) (= (TupleInt_length __var__shape) (Int___init__ 1)) (= (TupleInt___getitem__ __var__shape (Int___init__ 0)) (Int___init__ -1))) :ruleset array_api_ruleset)\n(function TupleValue_length (TupleValue) Int)\n(rewrite (NDArray_shape (NDArray_vector __var__vs)) (TupleInt_single (TupleValue_length __var__vs)) :ruleset array_api_ruleset)\n(function Value_dtype (Value) DType)\n(function TupleValue___getitem__ (TupleValue Int) Value)\n(rewrite (NDArray_dtype (NDArray_vector __var__vs)) (Value_dtype (TupleValue___getitem__ __var__vs (Int___init__ 0))) :ruleset array_api_ruleset)\n(rewrite (NDArray_index (NDArray_vector __var__vs) __var__ti) (TupleValue___getitem__ __var__vs (TupleInt___getitem__ __var__ti (Int___init__ 0))) :ruleset array_api_ruleset)\n(function TupleInt_EMPTY () TupleInt)\n(rewrite (NDArray_shape (NDArray_scalar __var__v)) (TupleInt_EMPTY) :ruleset array_api_ruleset)\n(rewrite (NDArray_dtype (NDArray_scalar __var__v)) (Value_dtype __var__v) :ruleset array_api_ruleset)\n(rewrite (NDArray_index (NDArray_scalar __var__v) (TupleInt_EMPTY)) __var__v :ruleset array_api_ruleset)\n(function any (NDArray) NDArray)\n(function TupleValue_includes (TupleValue Value) Boolean)\n(function Value_to_truthy_value (Value) Value)\n(rewrite (any __var__x) (NDArray_scalar (Value_bool (TupleValue_includes (possible_values (Value_to_truthy_value (NDArray_index __var__x (ALL_INDICES)))) (Value_bool (TRUE))))) :ruleset array_api_ruleset)\n(function NDArray___lt__ (NDArray NDArray) NDArray)\n(function Value___lt__ (Value Value) Value)\n(function broadcast_index (TupleInt TupleInt TupleInt) TupleInt)\n(function broadcast_shapes (TupleInt TupleInt) TupleInt)\n(rewrite (NDArray_index (NDArray___lt__ __var__x __var__y) __var__idx) (Value___lt__ (NDArray_index __var__x (broadcast_index (NDArray_shape __var__x) (broadcast_shapes (NDArray_shape __var__x) (NDArray_shape __var__y)) __var__idx)) (NDArray_index __var__y (broadcast_index (NDArray_shape __var__y) (broadcast_shapes (NDArray_shape __var__x) (NDArray_shape __var__y)) __var__idx))) :ruleset array_api_ruleset)\n(function NDArray___truediv__ (NDArray NDArray) NDArray)\n(function Value___truediv__ (Value Value) Value)\n(rewrite (NDArray_index (NDArray___truediv__ __var__x __var__y) __var__idx) (Value___truediv__ (NDArray_index __var__x (broadcast_index (NDArray_shape __var__x) (broadcast_shapes (NDArray_shape __var__x) (NDArray_shape __var__y)) __var__idx)) (NDArray_index __var__y (broadcast_index (NDArray_shape __var__y) (broadcast_shapes (NDArray_shape __var__x) (NDArray_shape __var__y)) __var__idx))) :ruleset array_api_ruleset)\n(rewrite (NDArray_index (NDArray_scalar __var__v) __var__idx) __var__v :ruleset array_api_ruleset)\n(function astype (NDArray DType) NDArray)\n(function Value_astype (Value DType) Value)\n(rewrite (NDArray_index (astype __var__x __var__dtype) __var__idx) (Value_astype (NDArray_index __var__x __var__idx) __var__dtype) :ruleset array_api_ruleset)\n(relation greater_zero (Value))\n(sort TupleNDArray)\n(function TupleNDArray___getitem__ (TupleNDArray Int) NDArray)\n(function unique_counts (NDArray) TupleNDArray)\n(rule ((= __var__v (NDArray_index (TupleNDArray___getitem__ (unique_counts __var__x) (Int___init__ 1)) __var__idx)))\n ((greater_zero __var__v))\n :ruleset array_api_ruleset )\n(rule ((greater_zero __var__v)\n (= __var__v1 (Value_astype __var__v __var__dtype)))\n ((greater_zero __var__v1))\n :ruleset array_api_ruleset )\n(rule ((= __var__v (Value_float (Float___init__ __var__f)))\n (> __var__f 0.0))\n ((greater_zero __var__v))\n :ruleset array_api_ruleset )\n(rule ((= __var__v (Value_int (Int___init__ __var__i)))\n (> __var__i 0))\n ((greater_zero __var__v))\n :ruleset array_api_ruleset )\n(rule ((greater_zero __var__v)\n (greater_zero __var__v1)\n (= __var__v2 (Value___truediv__ __var__v __var__v1)))\n ((greater_zero __var__v2))\n :ruleset array_api_ruleset )\n(rule ((greater_zero __var__v)\n (= __var__v1 (Value___lt__ __var__v (Value_int (Int___init__ 0)))))\n ((union __var__v1 (Value_bool (FALSE))))\n :ruleset array_api_ruleset )\n(function TupleValue___init__ (Value) TupleValue)\n(rewrite (possible_values (Value_bool __var__b)) (TupleValue___init__ (Value_bool __var__b)) :ruleset array_api_ruleset)\n(rule ((= __var__v1 (Value_astype __var__v __var__dtype))\n (greater_zero __var__v))\n ((greater_zero __var__v1))\n :ruleset array_api_ruleset )\n(function TupleNDArray_length (TupleNDArray) Int)\n(function svd (NDArray Boolean) TupleNDArray)\n(rewrite (TupleNDArray_length (svd __var__x __var__full_matrices)) (Int___init__ 3) :ruleset array_api_ruleset)\n(function unique_inverse (NDArray) TupleNDArray)\n(rewrite (TupleNDArray_length (unique_inverse __var__x)) (Int___init__ 2) :ruleset array_api_ruleset)\n(rewrite (TupleNDArray___getitem__ (unique_inverse __var__x) (Int___init__ 0)) (unique_values __var__x) :ruleset array_api_ruleset)\n(function ndarray-abs (NDArray) NDArray)\n(function Float_abs (Float) Float)\n(rewrite (ndarray-abs (NDArray_scalar (Value_float __var__f))) (NDArray_scalar (Value_float (Float_abs __var__f))) :ruleset array_api_ruleset)\n(rewrite (TupleNDArray_length (unique_counts __var__x)) (Int___init__ 2) :ruleset array_api_ruleset)\n(rewrite (sum (TupleNDArray___getitem__ (unique_counts __var__x) (Int___init__ 1)) (OptionalIntOrTuple_none)) (NDArray_scalar (Value_int (NDArray_size __var__x))) :ruleset array_api_ruleset)\n(rewrite (sum (astype (TupleNDArray___getitem__ (unique_counts __var__x) (Int___init__ 1)) __var__dtype) (OptionalIntOrTuple_none)) (astype (NDArray_scalar (Value_int (NDArray_size __var__x))) __var__dtype) :ruleset array_api_ruleset)\n(rewrite (NDArray_dtype (astype __var__x __var__dtype)) __var__dtype :ruleset array_api_ruleset)\n(function DType_float64 () DType)\n(rewrite (astype (NDArray_scalar (Value_int (Int___init__ __var__i))) (DType_float64)) (NDArray_scalar (Value_float (Float___init__ (to-f64 __var__i)))) :ruleset array_api_ruleset)\n(sort OptionalInt)\n(function concat (TupleNDArray OptionalInt) NDArray)\n(function TupleNDArray___init__ (NDArray) TupleNDArray)\n(function OptionalInt_none () OptionalInt)\n(rewrite (concat (TupleNDArray___init__ __var__x) (OptionalInt_none)) __var__x :ruleset array_api_ruleset)\n(rewrite (unique_values (unique_values __var__x)) (unique_values __var__x) :ruleset array_api_ruleset)\n(rewrite (sum (NDArray___truediv__ __var__x (NDArray_scalar __var__v)) (OptionalIntOrTuple_none)) (NDArray___truediv__ (sum __var__x (OptionalIntOrTuple_none)) (NDArray_scalar __var__v)) :ruleset array_api_ruleset)\n(function NDArray_ndim (NDArray) Int)\n(sort OptionalDType)\n(sort OptionalDevice)\n(function asarray (NDArray OptionalDType OptionalBool OptionalDevice) NDArray)\n(function OptionalDevice_none () OptionalDevice)\n(rewrite (NDArray_ndim (asarray __var__a __var__d __var__ob (OptionalDevice_none))) (NDArray_ndim __var__a) :ruleset array_api_ruleset)\n(function OptionalDType_none () OptionalDType)\n(function OptionalBool_none () OptionalBool)\n(rewrite (asarray __var__a (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) __var__a :ruleset array_api_ruleset)\n(function TupleNDArray___add__ (TupleNDArray TupleNDArray) TupleNDArray)\n(function TupleNDArray_EMPTY () TupleNDArray)\n(rewrite (TupleNDArray___add__ __var__ti (TupleNDArray_EMPTY)) __var__ti :ruleset array_api_ruleset)\n(rewrite (TupleNDArray_length (TupleNDArray___init__ __var__n)) (Int___init__ 1) :ruleset array_api_ruleset)\n(rewrite (TupleNDArray_length (TupleNDArray___add__ __var__ti __var__ti2)) (Int___add__ (TupleNDArray_length __var__ti) (TupleNDArray_length __var__ti2)) :ruleset array_api_ruleset)\n(rewrite (NDArray_ndim __var__x) (TupleInt_length (NDArray_shape __var__x)) :ruleset array_api_ruleset)\n(function NDArray_to_value (NDArray) Value)\n(rewrite (NDArray_to_value __var__x) (NDArray_index __var__x (TupleInt_EMPTY)) :ruleset array_api_ruleset)\n(rewrite (NDArray___truediv__ (NDArray_scalar (Value_float __var__f)) (NDArray_scalar (Value_float __var__f))) (NDArray_scalar (Value_float (Float___init__ 1.0))) :ruleset array_api_ruleset)\n(function NDArray___sub__ (NDArray NDArray) NDArray)\n(rewrite (NDArray___sub__ (NDArray_scalar (Value_float __var__f)) (NDArray_scalar (Value_float __var__f))) (NDArray_scalar (Value_float (Float___init__ 0.0))) :ruleset array_api_ruleset)\n(function NDArray___gt__ (NDArray NDArray) NDArray)\n(rewrite (NDArray___gt__ (NDArray_scalar (Value_float (Float___init__ __var__fi1))) (NDArray_scalar (Value_float (Float___init__ __var__fi2)))) (NDArray_scalar (Value_bool (TRUE))) :when ((> __var__fi1 __var__fi2)) :ruleset array_api_ruleset)\n(rewrite (NDArray___gt__ (NDArray_scalar (Value_float (Float___init__ __var__fi1))) (NDArray_scalar (Value_float (Float___init__ __var__fi2)))) (NDArray_scalar (Value_bool (FALSE))) :when ((<= __var__fi1 __var__fi2)) :ruleset array_api_ruleset)\n(function NDArray_T (NDArray) NDArray)\n(rewrite (NDArray_T (NDArray_T __var__x)) __var__x :ruleset array_api_ruleset)\n(function TupleValue___add__ (TupleValue TupleValue) TupleValue)\n(function TupleValue_EMPTY () TupleValue)\n(rewrite (TupleValue___add__ __var__ti (TupleValue_EMPTY)) __var__ti :ruleset array_api_ruleset)\n(rewrite (TupleValue_length (TupleValue_EMPTY)) (Int___init__ 0) :ruleset array_api_ruleset)\n(rewrite (TupleValue_length (TupleValue___init__ __var__v)) (Int___init__ 1) :ruleset array_api_ruleset)\n(rewrite (TupleValue_length (TupleValue___add__ __var__ti __var__ti2)) (Int___add__ (TupleValue_length __var__ti) (TupleValue_length __var__ti2)) :ruleset array_api_ruleset)\n(rewrite (TupleValue___getitem__ (TupleValue___init__ __var__v) (Int___init__ 0)) __var__v :ruleset array_api_ruleset)\n(rewrite (TupleValue___getitem__ (TupleValue___add__ (TupleValue___init__ __var__v) __var__ti) (Int___init__ 0)) __var__v :ruleset array_api_ruleset)\n(rule ((= __var__v (TupleValue___getitem__ (TupleValue___add__ (TupleValue___init__ __var__v2) __var__ti) (Int___init__ __var__k)))\n (> __var__k 0))\n ((union __var__v (TupleValue___getitem__ __var__ti (Int___init__ (- __var__k 1)))))\n :ruleset array_api_ruleset )\n(rewrite (TupleValue_includes (TupleValue_EMPTY) __var__v) (FALSE) :ruleset array_api_ruleset)\n(rewrite (TupleValue_includes (TupleValue___init__ __var__v) __var__v) (TRUE) :ruleset array_api_ruleset)\n(rewrite (TupleValue_includes (TupleValue___init__ __var__v) __var__v2) (FALSE) :when ((!= __var__v __var__v2)) :ruleset array_api_ruleset)\n(rewrite (TupleValue_includes (TupleValue___add__ __var__ti __var__ti2) __var__v) (Boolean___or__ (TupleValue_includes __var__ti __var__v) (TupleValue_includes __var__ti2 __var__v)) :ruleset array_api_ruleset)\n(function DType_int64 () DType)\n(rewrite (Value_dtype (Value_int __var__i)) (DType_int64) :ruleset array_api_ruleset)\n(rewrite (Value_dtype (Value_float __var__f)) (DType_float64) :ruleset array_api_ruleset)\n(function DType_bool () DType)\n(rewrite (Value_dtype (Value_bool __var__b)) (DType_bool) :ruleset array_api_ruleset)\n(function Value_to_bool (Value) Boolean)\n(rewrite (Value_to_bool (Value_bool __var__b)) __var__b :ruleset array_api_ruleset)\n(function Value_to_int (Value) Int)\n(rewrite (Value_to_int (Value_int __var__i)) __var__i :ruleset array_api_ruleset)\n(rewrite (Value_to_truthy_value (Value_bool __var__b)) (Value_bool __var__b) :ruleset array_api_ruleset)\n(sort IsDtypeKind)\n(function isdtype (DType IsDtypeKind) Boolean)\n(function DType_float32 () DType)\n(function IsDtypeKind_string (String) IsDtypeKind)\n(rewrite (isdtype (DType_float32) (IsDtypeKind_string \"integral\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_float64) (IsDtypeKind_string \"integral\")) (FALSE) :ruleset array_api_ruleset)\n(function DType_object () DType)\n(rewrite (isdtype (DType_object) (IsDtypeKind_string \"integral\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_int64) (IsDtypeKind_string \"integral\")) (TRUE) :ruleset array_api_ruleset)\n(function DType_int32 () DType)\n(rewrite (isdtype (DType_int32) (IsDtypeKind_string \"integral\")) (TRUE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_float32) (IsDtypeKind_string \"real floating\")) (TRUE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_float64) (IsDtypeKind_string \"real floating\")) (TRUE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_object) (IsDtypeKind_string \"real floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_int64) (IsDtypeKind_string \"real floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_int32) (IsDtypeKind_string \"real floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_float32) (IsDtypeKind_string \"complex floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_float64) (IsDtypeKind_string \"complex floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_object) (IsDtypeKind_string \"complex floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_int64) (IsDtypeKind_string \"complex floating\")) (FALSE) :ruleset array_api_ruleset)\n(rewrite (isdtype (DType_int32) (IsDtypeKind_string \"complex floating\")) (FALSE) :ruleset array_api_ruleset)\n(function IsDtypeKind_NULL () IsDtypeKind)\n(rewrite (isdtype __var__d (IsDtypeKind_NULL)) (FALSE) :ruleset array_api_ruleset)\n(function IsDtypeKind_dtype (DType) IsDtypeKind)\n(rewrite (isdtype __var__d (IsDtypeKind_dtype __var__d)) (TRUE) :ruleset array_api_ruleset)\n(function IsDtypeKind___or__ (IsDtypeKind IsDtypeKind) IsDtypeKind :cost 10)\n(rewrite (isdtype __var__d (IsDtypeKind___or__ __var__k1 __var__k2)) (Boolean___or__ (isdtype __var__d __var__k1) (isdtype __var__d __var__k2)) :ruleset array_api_ruleset)\n(rewrite (IsDtypeKind___or__ __var__k1 (IsDtypeKind_NULL)) __var__k1 :ruleset array_api_ruleset)\n(function DType___eq__ (DType DType) Boolean)\n(rewrite (DType___eq__ (DType_float64) (DType_float64)) (TRUE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float64) (DType_float32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float64) (DType_int32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float64) (DType_int64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float64) (DType_object)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float32) (DType_float64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float32) (DType_float32)) (TRUE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float32) (DType_int32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float32) (DType_int64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_float32) (DType_object)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int32) (DType_float64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int32) (DType_float32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int32) (DType_int32)) (TRUE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int32) (DType_int64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int32) (DType_object)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int64) (DType_float64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int64) (DType_float32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int64) (DType_int32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int64) (DType_int64)) (TRUE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_int64) (DType_object)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_object) (DType_float64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_object) (DType_float32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_object) (DType_int32)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_object) (DType_int64)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (DType___eq__ (DType_object) (DType_object)) (TRUE) :ruleset array_api_ruleset)\n(function cast_Callable__UnstableFn_Int__Int___Int___Int___lambda_idx_fn__i__idx_fn_i_+_Int_1___ (UnstableFn_Int_Int Int) Int)\n(rewrite (cast_Callable__UnstableFn_Int__Int___Int___Int___lambda_idx_fn__i__idx_fn_i_+_Int_1___ __var__idx_fn __var__i) (unstable-app __var__idx_fn (Int___add__ __var__i (Int___init__ 1))) :ruleset array_api_ruleset)\n(rewrite (index_vec_int __var__vs (Int___init__ __var__k)) (vec-get __var__vs __var__k) :ruleset array_api_ruleset)\n(rewrite (TupleInt_length (TupleInt___init__ __var__i __var__idx_fn)) __var__i :ruleset array_api_ruleset)\n(rewrite (TupleInt___getitem__ (TupleInt___init__ __var__i __var__idx_fn) __var__i2) (unstable-app __var__idx_fn __var__i2) :ruleset array_api_ruleset)\n(rewrite (TupleInt_fold (TupleInt___init__ (Int___init__ 0) __var__idx_fn) __var__i __var__f) __var__i :ruleset array_api_ruleset)\n(rewrite (TupleInt_fold (TupleInt___init__ (Int___init__ __var__k) __var__idx_fn) __var__i __var__f) (unstable-app __var__f (TupleInt_fold (TupleInt___init__ (Int___init__ (- __var__k 1)) (unstable-fn \"cast_Callable__UnstableFn_Int__Int___Int___Int___lambda_idx_fn__i__idx_fn_i_+_Int_1___\" __var__idx_fn)) __var__i __var__f) (unstable-app __var__idx_fn (Int___init__ 0))) :when ((!= __var__k 0)) :ruleset array_api_ruleset)\n(rewrite (TupleInt_fold_boolean (TupleInt___init__ (Int___init__ 0) __var__idx_fn) __var__b __var__bool_f) __var__b :ruleset array_api_ruleset)\n(rewrite (TupleInt_fold_boolean (TupleInt___init__ (Int___init__ __var__k) __var__idx_fn) __var__b __var__bool_f) (unstable-app __var__bool_f (TupleInt_fold_boolean (TupleInt___init__ (Int___init__ (- __var__k 1)) (unstable-fn \"cast_Callable__UnstableFn_Int__Int___Int___Int___lambda_idx_fn__i__idx_fn_i_+_Int_1___\" __var__idx_fn)) __var__b __var__bool_f) (unstable-app __var__idx_fn (Int___init__ 0))) :when ((!= __var__k 0)) :ruleset array_api_ruleset)\n(function bottom_indexing (Int) Int)\n(rewrite (TupleInt_EMPTY) (TupleInt___init__ (Int___init__ 0) (unstable-fn \"bottom_indexing\")) :ruleset array_api_ruleset)\n(rewrite (Float_abs (Float___init__ __var__f)) (Float___init__ __var__f) :when ((>= __var__f 0.0)) :ruleset array_api_ruleset)\n(rewrite (Float_abs (Float___init__ __var__f)) (Float___init__ (neg __var__f)) :when ((< __var__f 0.0)) :ruleset array_api_ruleset)\n(function Float_rational (Rational) Float :cost 2)\n(rewrite (Float___init__ __var__f) (Float_rational (rational (to-i64 __var__f) 1)) :when ((= (to-f64 (to-i64 __var__f)) __var__f)) :ruleset array_api_ruleset)\n(function Float_from_int (Int) Float)\n(rewrite (Float_from_int (Int___init__ __var__i)) (Float_rational (rational __var__i 1)) :ruleset array_api_ruleset)\n(function Float___add__ (Float Float) Float)\n(rewrite (Float___add__ (Float___init__ __var__f) (Float___init__ __var__f2)) (Float___init__ (+ __var__f __var__f2)) :ruleset array_api_ruleset)\n(function Float___sub__ (Float Float) Float)\n(rewrite (Float___sub__ (Float___init__ __var__f) (Float___init__ __var__f2)) (Float___init__ (- __var__f __var__f2)) :ruleset array_api_ruleset)\n(function Float___mul__ (Float Float) Float)\n(rewrite (Float___mul__ (Float___init__ __var__f) (Float___init__ __var__f2)) (Float___init__ (* __var__f __var__f2)) :ruleset array_api_ruleset)\n(function Float___truediv__ (Float Float) Float)\n(rewrite (Float___truediv__ (Float_rational __var__r) (Float_rational __var__r1)) (Float_rational (/ __var__r __var__r1)) :ruleset array_api_ruleset)\n(rewrite (Float___add__ (Float_rational __var__r) (Float_rational __var__r1)) (Float_rational (+ __var__r __var__r1)) :ruleset array_api_ruleset)\n(rewrite (Float___sub__ (Float_rational __var__r) (Float_rational __var__r1)) (Float_rational (- __var__r __var__r1)) :ruleset array_api_ruleset)\n(rewrite (Float___mul__ (Float_rational __var__r) (Float_rational __var__r1)) (Float_rational (* __var__r __var__r1)) :ruleset array_api_ruleset)\n(rewrite (Int___eq__ (Int___init__ __var__i) (Int___init__ __var__i)) (TRUE) :ruleset array_api_ruleset)\n(rule ((= __var__r (Int___eq__ (Int___init__ __var__i) (Int___init__ __var__j)))\n (!= __var__i __var__j))\n ((union __var__r (FALSE)))\n :ruleset array_api_ruleset )\n(function Int___ge__ (Int Int) Boolean)\n(rewrite (Int___ge__ (Int___init__ __var__i) (Int___init__ __var__i)) (TRUE) :ruleset array_api_ruleset)\n(rule ((= __var__r (Int___ge__ (Int___init__ __var__i) (Int___init__ __var__j)))\n (> __var__i __var__j))\n ((union __var__r (TRUE)))\n :ruleset array_api_ruleset )\n(rule ((= __var__r (Int___ge__ (Int___init__ __var__i) (Int___init__ __var__j)))\n (< __var__i __var__j))\n ((union __var__r (FALSE)))\n :ruleset array_api_ruleset )\n(rewrite (Int___lt__ (Int___init__ __var__i) (Int___init__ __var__i)) (FALSE) :ruleset array_api_ruleset)\n(rule ((= __var__r (Int___lt__ (Int___init__ __var__i) (Int___init__ __var__j)))\n (< __var__i __var__j))\n ((union __var__r (TRUE)))\n :ruleset array_api_ruleset )\n(rule ((= __var__r (Int___lt__ (Int___init__ __var__i) (Int___init__ __var__j)))\n (> __var__i __var__j))\n ((union __var__r (FALSE)))\n :ruleset array_api_ruleset )\n(function Int___gt__ (Int Int) Boolean)\n(rewrite (Int___gt__ (Int___init__ __var__i) (Int___init__ __var__i)) (FALSE) :ruleset array_api_ruleset)\n(rule ((= __var__r (Int___gt__ (Int___init__ __var__i) (Int___init__ __var__j)))\n (> __var__i __var__j))\n ((union __var__r (TRUE)))\n :ruleset array_api_ruleset )\n(rule ((= __var__r (Int___gt__ (Int___init__ __var__i) (Int___init__ __var__j)))\n (< __var__i __var__j))\n ((union __var__r (FALSE)))\n :ruleset array_api_ruleset )\n(function Int_i64 (Int) i64)\n(rule ((= __var__o (Int___init__ __var__j)))\n ((set (Int_i64 __var__o) __var__j))\n :ruleset array_api_ruleset )\n(rewrite (Int___add__ (Int___init__ __var__i) (Int___init__ __var__j)) (Int___init__ (+ __var__i __var__j)) :ruleset array_api_ruleset)\n(rewrite (Int___sub__ (Int___init__ __var__i) (Int___init__ __var__j)) (Int___init__ (- __var__i __var__j)) :ruleset array_api_ruleset)\n(rewrite (Int___mul__ (Int___init__ __var__i) (Int___init__ __var__j)) (Int___init__ (* __var__i __var__j)) :ruleset array_api_ruleset)\n(function Int___truediv__ (Int Int) Int)\n(rewrite (Int___truediv__ (Int___init__ __var__i) (Int___init__ __var__j)) (Int___init__ (/ __var__i __var__j)) :ruleset array_api_ruleset)\n(function Int___mod__ (Int Int) Int)\n(rewrite (Int___mod__ (Int___init__ __var__i) (Int___init__ __var__j)) (Int___init__ (% __var__i __var__j)) :ruleset array_api_ruleset)\n(function Int___and__ (Int Int) Int)\n(rewrite (Int___and__ (Int___init__ __var__i) (Int___init__ __var__j)) (Int___init__ (& __var__i __var__j)) :ruleset array_api_ruleset)\n(function Int___or__ (Int Int) Int)\n(rewrite (Int___or__ (Int___init__ __var__i) (Int___init__ __var__j)) (Int___init__ (| __var__i __var__j)) :ruleset array_api_ruleset)\n(function Int___xor__ (Int Int) Int)\n(rewrite (Int___xor__ (Int___init__ __var__i) (Int___init__ __var__j)) (Int___init__ (^ __var__i __var__j)) :ruleset array_api_ruleset)\n(function Int___lshift__ (Int Int) Int)\n(rewrite (Int___lshift__ (Int___init__ __var__i) (Int___init__ __var__j)) (Int___init__ (<< __var__i __var__j)) :ruleset array_api_ruleset)\n(function Int___rshift__ (Int Int) Int)\n(rewrite (Int___rshift__ (Int___init__ __var__i) (Int___init__ __var__j)) (Int___init__ (>> __var__i __var__j)) :ruleset array_api_ruleset)\n(function Int___invert__ (Int) Int)\n(rewrite (Int___invert__ (Int___init__ __var__i)) (Int___init__ (not-i64 __var__i)) :ruleset array_api_ruleset)\n(rewrite (Int_if_ (TRUE) __var__o __var__b) __var__o :ruleset array_api_ruleset)\n(rewrite (Int_if_ (FALSE) __var__o __var__b) __var__b :ruleset array_api_ruleset)\n(function Boolean_bool (Boolean) bool)\n(rule ((= __var__x (TRUE)))\n ((set (Boolean_bool __var__x) true))\n :ruleset array_api_ruleset )\n(rule ((= __var__x (FALSE)))\n ((set (Boolean_bool __var__x) false))\n :ruleset array_api_ruleset )\n(rewrite (Boolean___or__ (TRUE) __var__x) (TRUE) :ruleset array_api_ruleset)\n(rewrite (Boolean___or__ (FALSE) __var__x) __var__x :ruleset array_api_ruleset)\n(function Boolean___and__ (Boolean Boolean) Boolean)\n(rewrite (Boolean___and__ (TRUE) __var__x) __var__x :ruleset array_api_ruleset)\n(rewrite (Boolean___and__ (FALSE) __var__x) (FALSE) :ruleset array_api_ruleset)\n(function Boolean_if_int (Boolean Int Int) Int)\n(rewrite (Boolean_if_int (TRUE) __var__i __var__j) __var__i :ruleset array_api_ruleset)\n(rewrite (Boolean_if_int (FALSE) __var__i __var__j) __var__j :ruleset array_api_ruleset)\n(function Boolean___invert__ (Boolean) Boolean)\n(rewrite (Boolean___invert__ (TRUE)) (FALSE) :ruleset array_api_ruleset)\n(rewrite (Boolean___invert__ (FALSE)) (TRUE) :ruleset array_api_ruleset)\n(ruleset ruleset_5218390416)\n(function NDArray___eq__ (NDArray NDArray) NDArray)\n(rewrite (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse __var__x) (Int___init__ 1)) (NDArray_scalar (Value_int __var__i))) (NDArray___eq__ __var__x (NDArray_scalar (NDArray_index (unique_values __var__x) (TupleInt_from_vec (vec-of __var__i))))) :subsume :ruleset ruleset_5218390416)\n(function count_values (NDArray NDArray) TupleValue :unextractable)\n(rewrite (TupleNDArray___getitem__ (unique_counts __var__x) (Int___init__ 1)) (NDArray_vector (count_values __var__x (unique_values __var__x))) :subsume :ruleset ruleset_5218390416)\n(rewrite (count_values __var__x (NDArray_vector (TupleValue___add__ (TupleValue___init__ __var__v) __var__tv))) (TupleValue___add__ (TupleValue___init__ (NDArray_to_value (sum (NDArray___eq__ __var__x (NDArray_scalar __var__v)) (OptionalIntOrTuple_none)))) (count_values __var__x (NDArray_vector __var__tv))) :subsume :ruleset ruleset_5218390416)\n(rewrite (count_values __var__x (NDArray_vector (TupleValue___init__ __var__v))) (TupleValue___init__ (NDArray_to_value (sum (NDArray___eq__ __var__x (NDArray_scalar __var__v)) (OptionalIntOrTuple_none)))) :subsume :ruleset ruleset_5218390416)\n(function std (NDArray OptionalIntOrTuple) NDArray)\n(sort IntOrTuple)\n(function OptionalIntOrTuple_some (IntOrTuple) OptionalIntOrTuple)\n(function IntOrTuple_int (Int) IntOrTuple)\n(function ndarray-sqrt (NDArray) NDArray)\n(function mean (NDArray OptionalIntOrTuple Boolean) NDArray)\n(function square (NDArray) NDArray)\n(rewrite (std __var__x (OptionalIntOrTuple_some (IntOrTuple_int __var__i))) (ndarray-sqrt (mean (square (NDArray___sub__ __var__x (mean __var__x (OptionalIntOrTuple_some (IntOrTuple_int __var__i)) (TRUE)))) (OptionalIntOrTuple_some (IntOrTuple_int __var__i)) (FALSE))) :subsume :ruleset ruleset_5218390416)\n(rewrite (mean __var__x (OptionalIntOrTuple_some (IntOrTuple_int __var__i)) (FALSE)) (NDArray___truediv__ (sum __var__x (OptionalIntOrTuple_some (IntOrTuple_int __var__i))) (NDArray_scalar (Value_int (TupleInt___getitem__ (NDArray_shape __var__x) __var__i)))) :subsume :ruleset ruleset_5218390416)\n(function expand_dims (NDArray Int) NDArray)\n(rewrite (mean __var__x (OptionalIntOrTuple_some (IntOrTuple_int __var__i)) (TRUE)) (expand_dims (NDArray___truediv__ (sum __var__x (OptionalIntOrTuple_some (IntOrTuple_int __var__i))) (NDArray_scalar (Value_int (TupleInt___getitem__ (NDArray_shape __var__x) __var__i)))) __var__i) :subsume :ruleset ruleset_5218390416)\n(function NDArray___matmul__ (NDArray NDArray) NDArray)\n(function NDArray_var (String) NDArray :cost 200)\n(function NDArray___setitem__ (NDArray IndexKey NDArray) NDArray)\n(function zeros (TupleInt OptionalDType OptionalDevice) NDArray)\n(function OptionalDType_some (DType) OptionalDType)\n(sort Device)\n(function OptionalDevice_some (Device) OptionalDevice)\n(function NDArray_device (NDArray) Device)\n(sort MultiAxisIndexKey)\n(function IndexKey_multi_axis (MultiAxisIndexKey) IndexKey)\n(sort MultiAxisIndexKeyItem)\n(sort Vec_MultiAxisIndexKeyItem (Vec MultiAxisIndexKeyItem))\n(function MultiAxisIndexKey_from_vec (Vec_MultiAxisIndexKeyItem) MultiAxisIndexKey)\n(function MultiAxisIndexKeyItem_int (Int) MultiAxisIndexKeyItem)\n(sort Slice)\n(function MultiAxisIndexKeyItem_slice (Slice) MultiAxisIndexKeyItem)\n(function Slice___init__ (OptionalInt OptionalInt OptionalInt) Slice)\n(function IndexKey_ndarray (NDArray) IndexKey)\n(function NDArray___mul__ (NDArray NDArray) NDArray)\n(function OptionalInt_some (Int) OptionalInt)\n(function IndexKey_slice (Slice) IndexKey)\n(simplify (saturate (seq (run array_api_ruleset) (run ruleset_5218390416))) (NDArray___getitem__ (NDArray___matmul__ (NDArray___sub__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___matmul__ (NDArray___truediv__ (astype (TupleNDArray___getitem__ (unique_counts (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (NDArray_scalar (Value_float (Float___init__ 150.0)))) (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))))) (NDArray___matmul__ (NDArray___truediv__ (NDArray_T (NDArray___truediv__ (NDArray___getitem__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0))))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (NDArray___truediv__ (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (FALSE)) (Int___init__ 2)) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_some (Value_to_int (NDArray_to_value (sum (astype (NDArray___gt__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0))))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (NDArray___truediv__ (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (FALSE)) (Int___init__ 1)) (NDArray_scalar (Value_float (Float___init__ 0.0001)))) (DType_int32)) (OptionalIntOrTuple_none))))) (OptionalInt_none))) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (NDArray___getitem__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0))))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (NDArray___truediv__ (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (FALSE)) (Int___init__ 1)) (IndexKey_slice (Slice___init__ (OptionalInt_none) (OptionalInt_some (Value_to_int (NDArray_to_value (sum (astype (NDArray___gt__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0))))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (NDArray___truediv__ (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (FALSE)) (Int___init__ 1)) (NDArray_scalar (Value_float (Float___init__ 0.0001)))) (DType_int32)) (OptionalIntOrTuple_none))))) (OptionalInt_none))))) (NDArray___getitem__ (NDArray_T (TupleNDArray___getitem__ (svd (NDArray___matmul__ (NDArray_T (NDArray___mul__ (ndarray-sqrt (NDArray___mul__ (NDArray___mul__ (NDArray_scalar (Value_int (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)))) (NDArray___truediv__ (astype (TupleNDArray___getitem__ (unique_counts (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (NDArray_scalar (Value_float (Float___init__ 150.0))))) (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0)) (Int___init__ 1)))))))) (NDArray_T (NDArray___sub__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (NDArray___matmul__ (NDArray___truediv__ (astype (TupleNDArray___getitem__ (unique_counts (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (NDArray_scalar (Value_float (Float___init__ 150.0)))) (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE)))))))) (NDArray___truediv__ (NDArray_T (NDArray___truediv__ (NDArray___getitem__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0))))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (NDArray___truediv__ (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (FALSE)) (Int___init__ 2)) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_some (Value_to_int (NDArray_to_value (sum (astype (NDArray___gt__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0))))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (NDArray___truediv__ (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (FALSE)) (Int___init__ 1)) (NDArray_scalar (Value_float (Float___init__ 0.0001)))) (DType_int32)) (OptionalIntOrTuple_none))))) (OptionalInt_none))) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (NDArray___getitem__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0))))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (NDArray___truediv__ (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (FALSE)) (Int___init__ 1)) (IndexKey_slice (Slice___init__ (OptionalInt_none) (OptionalInt_some (Value_to_int (NDArray_to_value (sum (astype (NDArray___gt__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0))))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (NDArray___truediv__ (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (FALSE)) (Int___init__ 1)) (NDArray_scalar (Value_float (Float___init__ 0.0001)))) (DType_int32)) (OptionalIntOrTuple_none))))) (OptionalInt_none)))))) (FALSE)) (Int___init__ 2))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_some (Value_to_int (NDArray_to_value (sum (astype (NDArray___gt__ (TupleNDArray___getitem__ (svd (NDArray___matmul__ (NDArray_T (NDArray___mul__ (ndarray-sqrt (NDArray___mul__ (NDArray___mul__ (NDArray_scalar (Value_int (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)))) (NDArray___truediv__ (astype (TupleNDArray___getitem__ (unique_counts (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (NDArray_scalar (Value_float (Float___init__ 150.0))))) (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0)) (Int___init__ 1)))))))) (NDArray_T (NDArray___sub__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (NDArray___matmul__ (NDArray___truediv__ (astype (TupleNDArray___getitem__ (unique_counts (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (NDArray_scalar (Value_float (Float___init__ 150.0)))) (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE)))))))) (NDArray___truediv__ (NDArray_T (NDArray___truediv__ (NDArray___getitem__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0))))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (NDArray___truediv__ (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (FALSE)) (Int___init__ 2)) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_some (Value_to_int (NDArray_to_value (sum (astype (NDArray___gt__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0))))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (NDArray___truediv__ (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (FALSE)) (Int___init__ 1)) (NDArray_scalar (Value_float (Float___init__ 0.0001)))) (DType_int32)) (OptionalIntOrTuple_none))))) (OptionalInt_none))) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (NDArray___getitem__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0))))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (NDArray___truediv__ (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (FALSE)) (Int___init__ 1)) (IndexKey_slice (Slice___init__ (OptionalInt_none) (OptionalInt_some (Value_to_int (NDArray_to_value (sum (astype (NDArray___gt__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0))))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (NDArray___truediv__ (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (FALSE)) (Int___init__ 1)) (NDArray_scalar (Value_float (Float___init__ 0.0001)))) (DType_int32)) (OptionalIntOrTuple_none))))) (OptionalInt_none)))))) (FALSE)) (Int___init__ 1)) (NDArray___mul__ (NDArray_scalar (Value_float (Float___init__ 0.0001))) (NDArray___getitem__ (TupleNDArray___getitem__ (svd (NDArray___matmul__ (NDArray_T (NDArray___mul__ (ndarray-sqrt (NDArray___mul__ (NDArray___mul__ (NDArray_scalar (Value_int (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)))) (NDArray___truediv__ (astype (TupleNDArray___getitem__ (unique_counts (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (NDArray_scalar (Value_float (Float___init__ 150.0))))) (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0)) (Int___init__ 1)))))))) (NDArray_T (NDArray___sub__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (NDArray___matmul__ (NDArray___truediv__ (astype (TupleNDArray___getitem__ (unique_counts (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (NDArray_scalar (Value_float (Float___init__ 150.0)))) (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE)))))))) (NDArray___truediv__ (NDArray_T (NDArray___truediv__ (NDArray___getitem__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0))))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (NDArray___truediv__ (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (FALSE)) (Int___init__ 2)) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_some (Value_to_int (NDArray_to_value (sum (astype (NDArray___gt__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0))))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (NDArray___truediv__ (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (FALSE)) (Int___init__ 1)) (NDArray_scalar (Value_float (Float___init__ 0.0001)))) (DType_int32)) (OptionalIntOrTuple_none))))) (OptionalInt_none))) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (NDArray___getitem__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0))))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (NDArray___truediv__ (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (FALSE)) (Int___init__ 1)) (IndexKey_slice (Slice___init__ (OptionalInt_none) (OptionalInt_some (Value_to_int (NDArray_to_value (sum (astype (NDArray___gt__ (TupleNDArray___getitem__ (svd (NDArray___mul__ (ndarray-sqrt (asarray (NDArray_scalar (Value_float (Float___truediv__ (Float___init__ 1.0) (Float_from_int (Int___sub__ (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none)))) (Int___init__ 0))))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (NDArray___truediv__ (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (NDArray___setitem__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (IndexKey_ndarray (NDArray___eq__ (std (concat (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 0)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___add__ (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 1)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))) (TupleNDArray___init__ (NDArray___sub__ (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (NDArray___getitem__ (unique_values (concat (TupleNDArray___init__ (unique_values (asarray (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalInt_none))) (IndexKey_int (Int___init__ 2)))))) (NDArray___getitem__ (NDArray___setitem__ (NDArray___setitem__ (NDArray___setitem__ (zeros (TupleInt_from_vec (vec-of (TupleInt___getitem__ (NDArray_shape (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 0))) (Int___init__ 0)) (TupleInt___getitem__ (NDArray_shape (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)))) (OptionalDType_some (NDArray_dtype (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)))) (OptionalDevice_some (NDArray_device (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 0)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 0)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 1)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 1)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none)))))) (mean (NDArray___getitem__ (asarray (assume_isfinite (assume_shape (assume_dtype (NDArray_var \"X\") (DType_float64)) (TupleInt_from_vec (vec-of (Int___init__ 150) (Int___init__ 4))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (IndexKey_ndarray (NDArray___eq__ (TupleNDArray___getitem__ (unique_inverse (asarray (reshape (asarray (assume_value_one_of (assume_shape (assume_dtype (NDArray_var \"y\") (DType_int64)) (TupleInt_from_vec (vec-of (Int___init__ 150)))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 0))) (TupleValue___add__ (TupleValue___init__ (Value_int (Int___init__ 1))) (TupleValue___init__ (Value_int (Int___init__ 2)))))) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none)) (TupleInt_from_vec (vec-of (Int___init__ -1))) (OptionalBool_none)) (OptionalDType_none) (OptionalBool_none) (OptionalDevice_none))) (Int___init__ 1)) (NDArray_scalar (Value_int (Int___init__ 2)))))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0))) (FALSE))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_int (Int___init__ 2)) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))))))))))) (OptionalInt_some (Int___init__ 0))) (OptionalIntOrTuple_some (IntOrTuple_int (Int___init__ 0)))) (NDArray_scalar (Value_int (Int___init__ 0))))) (NDArray_scalar (Value_float (Float___init__ 1.0)))))) (FALSE)) (Int___init__ 1)) (NDArray_scalar (Value_float (Float___init__ 0.0001)))) (DType_int32)) (OptionalIntOrTuple_none))))) (OptionalInt_none)))))) (FALSE)) (Int___init__ 1)) (IndexKey_int (Int___init__ 0))))) (DType_int32)) (OptionalIntOrTuple_none))))) (OptionalInt_none))))))))) (IndexKey_multi_axis (MultiAxisIndexKey_from_vec (vec-of (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_none) (OptionalInt_none))) (MultiAxisIndexKeyItem_slice (Slice___init__ (OptionalInt_none) (OptionalInt_some (Int___init__ 2)) (OptionalInt_none))))))))\n", + "string": "; Tests for the string sort\n\n; Concatenation\n(check (= (+ \"a\" \"bc\" \"de\") \"abcde\"))\n; Counting the number of substring occurances\n(check (= (count-matches \"ab ab\" \"ab\") 2))\n; replacing a substring\n(check (= (replace \"ab ab\" \"ab\" \"cd\") \"cd cd\"))\n", + "string_quotes": "(function f () String)\n(input f \"tests/string_quotes.csv\")\n(check (= (f) \"abc\"))\n", + "subsume": ";; Let's pretend that we are optimizing mathematical expressions, but for some reason on our compiler\n;; multiplying by three is very expensive. So we want to rewrite those forms to three additions instead, and always\n;; extract that form.\n\n(datatype Math\n (Num i64)\n (Var String)\n (Add Math Math)\n (Mul Math Math))\n\n\n(rewrite (Mul (Num 3) x) (Add x (Add x x)) :subsume)\n\n(let x (Mul (Num 2) (Mul (Num 3) (Var \"x\"))))\n\n(run 10)\n\n; When X is extracted, we get the optimized form, where the * 3 is expanded out\n(check (= x (Mul (Num 2) (Add (Var \"x\") (Add (Var \"x\") (Var \"x\"))))))\n(extract x)\n; Will be (Mul (Num 2) (Add (Var \"x\") (Add (Var \"x\") (Var \"x\"))))\n\n; Even though it can't be extracted, we can still check that x equal 2 * (3 * x)\n(check (= x (Mul (Num 2) (Mul (Num 3) (Var \"x\")))))\n\n; Also if we make multiplication commutative and run that run, we won't get that result either\n; since the original expr has been subsumed when it was replaced with the addition\n(rewrite (Mul x y) (Mul y x))\n(run 10)\n(extract x)\n", + "test-combined-steps": "; Step with alternating feet, left before right\n(relation left (i64))\n(relation right (i64))\n(relation middle (i64))\n\n(left 0)\n(right 0)\n\n(ruleset step-left)\n(rule ((left x) (right x))\n ((left (+ x 1)))\n :ruleset step-left)\n\n(ruleset step-right)\n(rule ((left x) (right y) (= x (+ y 1)))\n ((right x))\n :ruleset step-right)\n\n(ruleset step-middle)\n(rule ((left x))\n ((middle x))\n :ruleset step-middle)\n\n(unstable-combined-ruleset\n my-combination \n step-left step-right \n step-middle)\n\n(run-schedule (repeat 1 my-combination))\n\n(check (left 1))\n(check (right 0))\n;; middle didn't observe anything except original step\n(check (middle 0))\n(fail (check (left 2)))\n(fail (check (right 1)))\n(fail (check (middle 1)))\n(fail (check (middle 2)))\n\n\n(run-schedule\n (repeat 9\n (saturate step-right)\n my-combination\n (saturate step-right)))\n\n(check (left 10))\n(check (right 10))\n;; middle didn't get a chance to observe (left 10)\n(check (middle 9))\n(fail (check (middle 10)))\n(fail (check (left 11)))\n(fail (check (right 11)))\n", + "test-combined": "(relation edge (i64 i64))\n(relation path (i64 i64))\n\n\n(ruleset myrules1)\n(rule ((edge x y))\n ((path x y))\n :ruleset myrules1)\n(ruleset myrules2)\n(rule ((path x y) (edge y z))\n ((path x z))\n :ruleset myrules2)\n\n(unstable-combined-ruleset myrules-combined\n myrules1 myrules2)\n\n\n(edge 0 1)\n(edge 1 2)\n(edge 2 3)\n(edge 2 4)\n\n(run-schedule\n (repeat 3 myrules-combined))\n\n\n(check (path 0 1))\n(check (path 0 2))\n(check (path 0 3))\n(check (path 0 4))\n(check (path 1 2))\n(check (path 1 3))\n(check (path 1 4))\n", + "towers-of-hanoi": "(datatype Stack\n (Empty)\n (Cons i64 Stack))\n\n(function Config (Stack Stack Stack) i64 :merge (min old new))\n\n;; move from first stack\n(rule ((= len (Config (Cons x a) b c)))\n ((set (Config a (Cons x b) c) (+ len 1))\n (set (Config a b (Cons x c)) (+ len 1))))\n\n;; move from second stack\n(rule ((= len (Config a (Cons x b) c)))\n ((set (Config (Cons x a) b c) (+ len 1))\n (set (Config a b (Cons x c)) (+ len 1))))\n\n;; move from third stack\n(rule ((= len (Config a b (Cons x c))))\n ((set (Config (Cons x a) b c) (+ len 1))\n (set (Config a (Cons x b) c) (+ len 1))))\n\n(let e (Empty))\n\n\n;; initial state [123 _ _] with path \"length\" 0\n(set (Config (Cons 1 (Cons 2 (Cons 3 e))) e e) 0)\n\n;; find all reachable states\n(run 1000000)\n\n;; print first 10 tuples\n(print-function Config 10)\n(print-size Config)\n\n;; how to long to move to state [_ _ 123]\n(query-extract (Config e e (Cons 1 (Cons 2 (Cons 3 e)))))\n\n;; actually do the assertion\n(check (= 5 (Config e e (Cons 1 (Cons 2 (Cons 3 e))))))", + "tricky-type-checking": ";;;;;;;;;;;;;;;;;;\n;; From repro-constraineq\n\n;; repro-constraineq\n(push)\n(rule ((= x 1) (= y x) (= z y)) ())\n(run 1)\n(pop)\n\n;; repro-constraineq2\n(push)\n(rule ((= x 1) (= y x)) ())\n(run 1)\n(pop)\n\n;; repro-constraineq3\n(push)\n(relation f (i64))\n\n(rule ((= x 1)\n (= x 2))\n ((f x)))\n \n(run 1)\n(print-function f 10)\n(pop)\n\n;;;;;;;;;;;;;;;;;;\n;; Atoms need to be order-insensitive\n\n;; Issue #196\n(push)\n(relation R (i64))\n\n(rule \n ((= x y)\n (= y 1)) \n ((R x)))\n(run 1)\n(check (R 1))\n(pop)\n\n(push)\n(relation R (i64))\n\n(rule \n ((= x (+ y 1))\n (= y 1)) \n ((R x)))\n(run 1)\n(check (R 2))\n(pop)\n\n;; Issue #80\n(push)\n(datatype TYPE)\n(datatype TERM)\n(function type (TERM) TYPE)\n(function Ob () TYPE)\n(function Hom (TERM TERM) TYPE)\n\n(function id (TERM) TERM)\n(rule ((type (id A)))\n ((type A)))\n(rewrite (type (id A)) \n (Hom A A) \n :when ((= (type A) (Ob))))\n\n(function compose (TERM TERM) TERM)\n(rule ((type (compose f g))) \n ((type f) \n (type g)))\n(rewrite (type (compose f g)) \n (Hom A C) \n :when ((= (type f) (Hom A B)) \n (= (type g) (Hom B C))))\n\n(birewrite (compose (compose f g) h) \n (compose f (compose g h)) \n :when ((= (type A) (Ob)) \n (= (type B) (Ob))\n (= (type C) (Ob))\n (= (type D) (Ob))\n (= (type f) (Hom A B))\n (= (type g) (Hom B C))\n (= (type h) (Hom C D))))\n(birewrite (compose f (id B)) f \n :when ((= (type A) (Ob)) \n (= (type B) (Ob))\n (= (type f) (Hom A B))))\n(birewrite (compose (id A) f) f \n :when ((= (type A) (Ob)) \n (= (type B) (Ob))\n (= (type f) (Hom A B))))\n\n(function AConst () TERM)\n(let A (AConst))\n(function BConst () TERM)\n(let B (BConst))\n(function fConst () TERM)\n(let f (fConst))\n(function gConst () TERM)\n(let g (gConst))\n(let fog (compose g f))\n(union (type f) (Hom A B))\n(union (type g) (Hom B A))\n(union (type A) (Ob))\n(union (type B) (Ob))\n(type fog)\n(run 10)\n(print-function type 10)\n(check (= (type f) \n (type (compose (id A) \n (compose f (id B))))))\n(check (= (type fog)\n (Hom B B)))\n(pop)\n\n\n;;;;;;;;;;;;;;;;;;\n;; Finding the right type in case of container types and primitives\n\n;; Issue #113\n\n(push)\n(sort MyMap (Map i64 String))\n(sort MyMap1 (Map i64 i64))\n\n(let my_map1 (map-insert (map-empty) 1 \"one\"))\n(pop)\n\n(push)\n(sort MyMap1 (Map i64 i64))\n(sort MyMap (Map i64 String))\n\n(let my_map1 (map-insert (map-empty) 1 \"one\"))\n(pop)\n\n", + "type-constraints-tests": "(datatype Operand)\n(sort VecOperandBase (Vec Operand))\n(datatype VecOperand (VO VecOperandBase))\n(sort VecVecOperandBase (Vec VecOperand))\n\n(rule\n ((= v1 (vec-of))\n (= v2 (VO v1))\n (= v3 (vec-of v2)))\n ())\n", + "typecheck": "; type checking for simply typed lambda calculus\n\n(datatype Type \n (TArr Type Type) ; t1 -> t2\n)\n(function TUnitConst () Type)\n(let TUnit (TUnitConst))\n\n(datatype Expr \n (Lam String Type Expr) ; lam x : t . e\n (App Expr Expr) \n (Var String) \n)\n(function MyUnitConst () Expr)\n(let MyUnit (MyUnitConst))\n\n(datatype Ctx \n (Cons String Type Ctx)\n)\n(function NilConst () Ctx)\n(let Nil (NilConst))\n\n; ctx |- expr : type\n(function typeof (Ctx Expr) Type)\n\n; ctx |- () : unit\n(rewrite (typeof ctx MyUnit) TUnit)\n\n; ctx; x: t |- x : t\n(rewrite (typeof (Cons x t ctx) (Var x)) t)\n\n; ctx |- f :- t1 -> t2\n; ctx |- e : t1\n; -----------------\n; ctx |- f e : t2\n\n(rule (\n (= (typeof ctx (App f e)) t2)\n)(\n (typeof ctx f)\n (typeof ctx e)\n))\n\n(rule (\n (= (typeof ctx (App f e)) t1)\n (= (typeof ctx f) (TArr (typeof ctx e) t2))\n)(\n (union t1 t2)\n))\n\n; ctx |- x : t\n; ------------------ y != x \n; ctx; y: t |- x : t\n\n(rewrite (typeof (Cons y ty ctx) (Var x))\n (typeof ctx (Var x))\n :when ((!= x y)))\n\n; ctx; x: t1 |- e : t2\n; ------------------------------\n; ctx |- lam x: t1. e : t1 -> t2\n\n; rhs of rewrite creates demand\n(rewrite (typeof ctx (Lam x t1 e))\n (TArr t1 (typeof (Cons x t1 ctx) e)))\n\n; TEST\n; ----\n\n; lam x : unit, f : unit -> unit . f x\n(let e \n (Lam \"x\" TUnit \n (Lam \"f\" (TArr TUnit TUnit)\n (App (Var \"f\") (Var \"x\")))))\n\n; lam x : unit . x\n(let id (Lam \"x\" TUnit (Var \"x\")))\n(let t-id (typeof Nil id))\n\n; (e () id) = ()\n(let app-unit-id (App (App e MyUnit) id))\n(let t-app (typeof Nil app-unit-id))\n\n(let free (Lam \"x\" TUnit (Var \"y\")))\n(let t-free-ill (typeof Nil free))\n(let t-free-1 (typeof (Cons \"y\" TUnit Nil) free))\n(let t-free-2 (typeof (Cons \"y\" (TArr (TArr TUnit TUnit) TUnit) Nil) free))\n\n(run 15)\n\n(query-extract t-id)\n(check (= t-id (TArr TUnit TUnit)))\n\n(query-extract t-app)\n(check (= t-app TUnit))\n\n(query-extract t-free-1)\n(check (= t-free-1 (TArr TUnit TUnit)))\n(query-extract t-free-2)\n(check (= t-free-2 (TArr TUnit (TArr (TArr TUnit TUnit) TUnit))))\n; this will err\n; (query-extract t-free-ill)\n", + "typeinfer": ";;;;;;;;;;;;;;;;;;;;;;\n;; Exprs and Types\n;;;;;;;;;;;;;;;;;;;;;;\n\n(datatype Ident)\n(datatype Expr)\n(datatype Type)\n(datatype Scheme)\n(datatype Ctx)\n;; TODO: can't do unit right now\n(sort QuantifiedVs (Set Ident))\n\n(function Fresh (Ident i64) Ident)\n(function V (String) Ident)\n\n(function Var (Ident) Expr)\n(function App (Expr Expr) Expr)\n(function Abs (Ident Expr) Expr)\n(function Let (Ident Expr Expr) Expr)\n(function Num (i64) Expr)\n(function True () Expr)\n(function False () Expr)\n(function MyUnit () Expr)\n\n(function TVar (Ident) Type :cost 3)\n(function TArr (Type Type) Type :cost 1)\n(function TInt () Type :cost 1)\n(function TBool () Type :cost 1)\n(function TUnit () Type :cost 1)\n\n(function Forall (QuantifiedVs Type) Scheme)\n(function Nil () Ctx)\n(function Cons (Ident Scheme Ctx) Ctx)\n\n(relation ftvCtx (Ctx QuantifiedVs))\n(relation ftv (Type QuantifiedVs))\n(relation ftvScheme (Scheme QuantifiedVs))\n(relation has-qs (Ctx Type QuantifiedVs))\n(relation has-qs-demand (Ctx Type))\n\n;;;;;;;;;;;;;;;;;;;;;;\n;; Expression size\n;;;;;;;;;;;;;;;;;;;;;;\n(relation expr-size (Expr i64))\n(rule ((= e (Num n)))((expr-size e 1)))\n(rule ((= e (Var x)))((expr-size e 1)))\n;; asserted facts will be cleared so we define them as rules\n(rule ((= e (True))) ((expr-size e 1)))\n(rule ((= e (False))) ((expr-size e 1)))\n(rule ((= e (MyUnit))) ((expr-size e 1)))\n(rule ((= e (App e1 e2)) \n (expr-size e1 s1) \n (expr-size e2 s2))\n ((expr-size e (+ (+ s1 s2) 1))))\n(rule ((= e (Let x e1 e2)) \n (expr-size e1 s1) \n (expr-size e2 s2))\n ((expr-size e (+ (+ s1 s2) 1))))\n(rule ((= e (Abs x e1)) \n (expr-size e1 s1))\n ((expr-size e (+ s1 1))))\n\n;;;;;;;;;;;;;;;;;;;;;;\n;; Scheme and Context\n;;;;;;;;;;;;;;;;;;;;;;\n\n(rule ((= e (TBool)))((ftv e (set-empty))))\n(rule ((= e (TUnit)))((ftv e (set-empty))))\n(rule ((= e (TInt)))((ftv e (set-empty))))\n(rule ((= e (TVar x)))((ftv e (set-insert (set-empty) x))))\n(rule ((= e (TArr fr to))\n (ftv fr s1)\n (ftv to s2))\n ((ftv e (set-union s1 s2))))\n(rule ((= c (Nil))) ((ftvCtx c (set-empty))))\n(rule ((= e (Forall qs t))\n (ftv t fvs))\n ((ftvScheme e (set-diff fvs qs)))) \n(rule ((= c (Cons x s n))\n (ftvCtx n fvs1)\n (ftvScheme s fvs2))\n ((ftvCtx c (set-union fvs1 fvs2))))\n\n\n;; TODO: rewrite lookup to use native sets\n(function lookup (Ctx Ident) Scheme :cost 1000)\n(rewrite (lookup (Cons x s tl) x) s)\n(rule (\n (= t (lookup (Cons y s tl) x))\n (!= x y)\n)(\n (union t (lookup tl x))\n))\n\n;;;;;;;;;;;;;;;;;;;;;;\n;; Generalization and Instantiation\n;;;;;;;;;;;;;;;;;;;;;;\n\n(function generalize (Ctx Type) Scheme :cost 1000)\n(function instantiate (Scheme i64) Type :cost 1000)\n\n(rule ((has-qs-demand ctx (TInt)))\n ((has-qs ctx (TInt) (set-empty))))\n(rule ((has-qs-demand ctx (TBool)))\n ((has-qs ctx (TBool) (set-empty))))\n(rule ((has-qs-demand ctx (TUnit)))\n ((has-qs ctx (TUnit) (set-empty))))\n\n(rule ((has-qs-demand ctx (TArr fr to)))\n ((has-qs-demand ctx fr)\n (has-qs-demand ctx to)))\n(rule ((has-qs-demand ctx (TArr fr to))\n (has-qs ctx fr qs1)\n (has-qs ctx to qs2))\n ((has-qs ctx (TArr fr to) (set-union qs1 qs2))))\n\n(rule ((has-qs-demand ctx (TVar x))\n (ftvCtx ctx key-set)\n (set-contains key-set x))\n ((has-qs ctx (TVar x) (set-empty))))\n(rule ((has-qs-demand ctx (TVar x))\n (ftvCtx ctx key-set)\n (set-not-contains key-set x))\n ((has-qs ctx (TVar x) (set-insert (set-empty) x))))\n\n(rule ((= sc (generalize ctx t)))\n ((has-qs-demand ctx t)))\n(rewrite (generalize ctx t)\n (Forall qs t)\n :when ((has-qs ctx t qs)))\n\n(function subst-fresh (QuantifiedVs Type i64) Type :cost 1000)\n(rewrite (subst-fresh vs (TInt) c) (TInt))\n(rewrite (subst-fresh vs (TBool) c) (TBool))\n(rewrite (subst-fresh vs (TUnit) c) (TUnit))\n(rewrite (subst-fresh vs (TArr fr to) c) \n (TArr (subst-fresh vs fr c) (subst-fresh vs to c)))\n(rule ((= otype (subst-fresh vs (TVar s) c))\n (set-contains vs s))\n ((union otype (TVar (Fresh s c)))))\n(rule ((= otype (subst-fresh vs (TVar s) c))\n (set-not-contains vs s))\n ((union otype (TVar s))))\n\n(rewrite (instantiate (Forall vs t) c)\n (subst-fresh vs t c))\n\n;;;;;;;;;;;;;;;;;;;;;;\n;; Injectivity\n;;;;;;;;;;;;;;;;;;;;;;\n\n(rule ((= (TArr fr1 to1) (TArr fr2 to2)))\n ((union fr1 fr2) \n (union to1 to2)))\n\n;;;;;;;;;;;;;;;;;;;;;;\n;; Type inference\n;;;;;;;;;;;;;;;;;;;;;;\n\n; ctx |- expr : type\n(function typeof (Ctx Expr i64) Type :cost 1000)\n\n;; Basic types (TInt, TBool, TUnit)\n(rewrite (typeof ctx (Num x) c) (TInt))\n(rewrite (typeof ctx (True) c) (TBool))\n(rewrite (typeof ctx (False) c) (TBool))\n(rewrite (typeof ctx (MyUnit) c) (TUnit))\n\n; sc = lookup(ctx, x)\n; t = instantiate(sc)\n; ---------------\n; ctx |- x : t\n(rewrite (typeof ctx (Var x) c)\n (instantiate (lookup ctx x) c))\n\n(rewrite \n (typeof ctx (Abs x e) c)\n (TArr (TVar (Fresh x c)) \n (typeof (Cons x (Forall (set-empty) (TVar (Fresh x c)))\n ctx)\n e cc))\n :when ((= cc (+ c 1))))\n\n(rule ((= to (typeof ctx (App e1 e2) c))\n (= c1 (+ c 1))\n (expr-size e1 sz)\n (= c2 (+ c (+ sz 1))))\n ((union (typeof ctx e1 c1) \n (TArr (typeof ctx e2 c2) to))))\n\n(rewrite (typeof ctx (Let x e1 e2) c)\n (typeof (Cons x (generalize ctx (typeof ctx e1 c1)) \n ctx)\n e2 c2)\n :when ((= c1 (+ c 1))\n (expr-size e1 sz)\n (= c2 (+ c (+ sz 1)))))\n\n;;;;;;;;;;;;;;;;;;;;;;\n;; Occurs check\n;;;;;;;;;;;;;;;;;;;;;;\n(relation occurs-check (Ident Type))\n(function errors () Ident)\n(rule ((= (TVar x) (TArr fr to)))\n ((occurs-check x fr)\n (occurs-check x to)))\n(rule ((occurs-check x (TVar x)))\n ;; ((set (errors) x)))\n ((panic \"occurs check fail\")))\n(rule ((occurs-check x (TArr fr to)))\n ((occurs-check x fr)\n (occurs-check x to)))\n\n(relation base-types (Type))\n(base-types (TInt))\n(base-types (TBool))\n(base-types (TUnit))\n(rule ((base-types t)\n (= t (TArr fr to)))\n ((panic \"Unifying base types with functions\")) )\n(rule ((= (TInt) (TBool))) ((panic \"Unifying base types\")))\n(rule ((= (TInt) (TUnit))) ((panic \"Unifying base types\")))\n(rule ((= (TBool) (TUnit))) ((panic \"Unifying base types\")))\n;;;;;;;;;;;;;;;;;;;;;;\n;; TEST\n;;;;;;;;;;;;;;;;;;;;;;\n\n(push)\n(let id (Abs (V \"x\") (Var (V \"x\"))))\n(let t-id (typeof (Nil) id 0))\n(run 100)\n(check (= t-id (TArr (TVar (Fresh (V \"x\") 0)) (TVar (Fresh (V \"x\") 0)))))\n(pop)\n\n(push)\n(let let-poly (Let (V \"id\") (Abs (V \"x\") (Var (V \"x\")))\n (App (App (Var (V \"id\")) (Var (V \"id\")))\n (App (Var (V \"id\")) (True)))))\n(let t-let-poly (typeof (Nil) let-poly 0))\n(run 100)\n(check (= t-let-poly (TBool)))\n(pop)\n\n(push)\n(let id-id (App (Abs (V \"x\") (Var (V \"x\")))\n (Abs (V \"y\") (Var (V \"y\")))))\n(let t-id-id (typeof (Nil) id-id 0))\n(run 100)\n(check (= t-id-id (TArr (TVar (Fresh (V \"y\") 3)) (TVar (Fresh (V \"y\") 3)))))\n(pop)\n\n\n(push)\n(let let-true (Let (V \"x\") (True) (True)))\n(let t-let-true (typeof (Nil) let-true 0))\n(run 100)\n(check (= t-let-true (TBool)))\n(pop)\n\n(push)\n\n(let let-var-true (Let (V \"x\") (True) (Var (V \"x\"))))\n(let t-let-var-true (typeof (Nil) let-var-true 0))\n(run 100)\n(check (= t-let-var-true (TBool)))\n(pop)\n\n(push)\n\n(let abs-id (Abs (V \"x\") \n (Let (V \"y\") (Abs (V \"z\") (Var (V \"z\"))) (Var (V \"y\")))))\n(let t-abs-id (typeof (Nil) abs-id 0))\n(run 100)\n(let x (Fresh (V \"x\") 0))\n(let z (Fresh (Fresh (V \"z\") 2) 4))\n(check (= t-abs-id (TArr (TVar x) (TArr (TVar z) (TVar z)))))\n(pop)\n\n(push)\n\n(let let-env (Let (V \"x\") (True) \n (Let (V \"f\") (Abs (V \"a\") (Var (V \"a\")))\n (Let (V \"x\") (MyUnit)\n (App (Var (V \"f\")) (Var (V \"x\")))\n ))))\n(let t-let-env (typeof (Nil) let-env 0))\n(run 100)\n(check (= t-let-env (TUnit)))\n(pop)\n\n(push)\n(let let-env-2a (Let (V \"x\") (MyUnit)\n (Let (V \"f\") (Abs (V \"y\") (Var (V \"x\")))\n (Let (V \"x\") (True)\n (App (Var (V \"f\")) (Var (V \"x\")))))))\n(let t-let-env-2a (typeof (Nil) let-env-2a 0))\n(run 100)\n(check (= t-let-env-2a (TUnit)))\n(pop)\n\n(push)\n\n(let let-env-2b (App (Abs (V \"x\")\n (Let (V \"f\") (Abs (V \"y\") (Var (V \"x\")))\n (Let (V \"x\") (True)\n (App (Var (V \"f\")) (Var (V \"x\"))))))\n (MyUnit)))\n(let t-let-env-2b (typeof (Nil) let-env-2b 0))\n(run 100)\n(check (= t-let-env-2b (TUnit)))\n(pop)\n\n(push)\n\n;; ((lambda (x) ((lambda (f) ((lambda (x) (f x)) #t)) (lambda (y) x))) 5)\n(let let-env-hard (App (Abs (V \"x\") \n (App (Abs (V \"f\") \n (App (Abs (V \"x\") (App (Var (V \"f\")) (Var (V \"x\")))) \n (True)))\n (Abs (V \"y\") (Var (V \"x\")))))\n (MyUnit)))\n(let t-let-env-hard (typeof (Nil) let-env-hard 0))\n(run 100)\n(check (= t-let-env-hard (TUnit)))\n(pop)\n\n(push)\n\n(let let-inst (Let (V \"id\") (Abs (V \"x\") (Var (V \"x\")))\n (Let (V \"iid\") (Abs (V \"y\") (Var (V \"id\")))\n (App (Var (V \"iid\")) \n (App (Var (V \"id\")) (True))))) )\n(let t-let-inst (typeof (Nil) let-inst 0))\n(run 100)\n(check (= t-let-inst (TArr (TVar (Fresh (Fresh (Fresh (V \"x\") 1) 5) 7)) (TVar (Fresh (Fresh (Fresh (V \"x\") 1) 5) 7)))))\n(pop)\n\n", + "unification-points-to": "(datatype FuncT (Func String))\n(datatype StmtT (Stmt String))\n(datatype ExprT (Expr String))\n(datatype FieldT (Field String))\n(datatype TypeT (Type String))\n(datatype AllocT (Alloc AllocT) (AllocVar ExprT))\n\n(relation func (FuncT ExprT TypeT TypeT))\n(relation func-stmt (FuncT StmtT))\n(relation assign (StmtT TypeT ExprT ExprT))\n(relation field-assign (StmtT ExprT FieldT ExprT))\n(relation store (StmtT ExprT ExprT))\n(relation expr (StmtT ExprT))\n(relation return (StmtT ExprT))\n(relation eq (ExprT ExprT ExprT))\n(relation call (ExprT FuncT ExprT))\n(relation add (ExprT ExprT ExprT))\n(relation field (ExprT ExprT FieldT))\n(relation struct-lit-field (ExprT FieldT ExprT))\n(relation addr (ExprT ExprT FieldT))\n(relation load (ExprT ExprT))\n(relation malloc (ExprT TypeT))\n\n;; typedef struct s {\n;; int x;\n;; int y;\n;; } s;\n\n;; int mul(struct s q) { ... }\n\n;; int fact(int i) {\n;; int c = i == 0;\n;; if (c) {\n;; return 1;\n;; } else {\n;; int j = i + -1;\n;; int r = fact(j);\n;; int prod = mul((struct s){i, r});\n;; return prod;\n;; }\n;; }\n;; (func (Func \"fact\") (Expr \"i\") (Type \"int\") (Type \"int\"))\n;; (func-stmt (Func \"fact\") (Stmt \"int c = i == 0;\"))\n;; (func-stmt (Func \"fact\") (Stmt \"if ...\"))\n;; (func-stmt (Func \"fact\") (Stmt \"return 1\"))\n;; (func-stmt (Func \"fact\") (Stmt \"int j = i + -1\"))\n;; (func-stmt (Func \"fact\") (Stmt \"int r = fact(j)\"))\n;; (func-stmt (Func \"fact\") (Stmt \"int prod = mul({ x: i, y: r })\"))\n;; (func-stmt (Func \"fact\") (Stmt \"return prod\"))\n;; (assign (Stmt \"int c = i == 0\") (Type \"int\") (Expr \"c\") (Expr \"i == 0\"))\n;; (assign (Stmt \"int j = i + -1\") (Type \"int\") (Expr \"j\") (Expr \"i + -1\"))\n;; (assign (Stmt \"int r = fact(j)\") (Type \"int\") (Expr \"r\") (Expr \"fact(j)\"))\n;; (assign (Stmt \"int prod = mul({ x: i, y: r })\") (Type \"int\") (Expr \"prod\") (Expr \"mul({ x: i, y: r })\"))\n;; (eq (Expr \"i == 0\") (Expr \"i\") (Expr \"0\"))\n;; (add (Expr \"i + -1\") (Expr \"i\") (Expr \"-1\"))\n;; (call (Expr \"fact(j)\") (Func \"fact\") (Expr \"j\"))\n;; (call (Expr \"mul({ x: i, y: r })\") (Func \"mul\") (Expr \"{ x: i, y: r }\"))\n;; (return (Stmt \"return prod\") (Expr \"prod\"))\n\n;; typedef struct s {\n;; int *x;\n;; int *y;\n;; } s;\n\n;; void swap(struct s *r) {\n;; int **xp = &(r->x);\n;; int **yp = &(r->y);\n;; int *a = *xp;\n;; int *b = *yp;\n;; *xp = a;\n;; *yp = b;\n;; }\n\n;; int f(int i) {\n;; struct s *sp = malloc(sizeof(struct s));\n;; int *u = malloc(sizeof(int));\n;; int *v = malloc(sizeof(int));\n;; *u = i;\n;; *v = i;\n;; *sp = (struct s){u, v};\n;; swap(sp);\n;; int **zpp = &(sp->x);\n;; int *zp = *zpp;\n;; return *zp;\n;; }\n(func (Func \"swap\") (Expr \"r\") (Type \"void\") (Type \"{int *x; int *y;}*\"))\n;; statements\n(func-stmt (Func \"swap\") (Stmt \"int **xp = &(r->x)\"))\n(func-stmt (Func \"swap\") (Stmt \"int **yp = &(r->y)\"))\n(func-stmt (Func \"swap\") (Stmt \"int *z = *xp\"))\n(func-stmt (Func \"swap\") (Stmt \"int *w = *yp\"))\n(func-stmt (Func \"swap\") (Stmt \"*xp = a\"))\n(func-stmt (Func \"swap\") (Stmt \"*yp = b\"))\n(assign (Stmt \"int **xp = &(r->x)\") (Type \"int **\") (Expr \"xp\") (Expr \"&(r->x)\"))\n(assign (Stmt \"int **yp = &(r->x)\") (Type \"int **\") (Expr \"yp\") (Expr \"&(r->y)\"))\n(assign (Stmt \"int *a = *xp\") (Type \"int *\") (Expr \"a\") (Expr \"*xp\"))\n(assign (Stmt \"int *b = *yp\") (Type \"int *\") (Expr \"b\") (Expr \"*yp\"))\n(store (Stmt \"*xp = a\") (Expr \"xp\") (Expr \"a\"))\n(store (Stmt \"*yp = b\") (Expr \"yp\") (Expr \"b\"))\n;; expressions\n(addr (Expr \"&(r->x)\") (Expr \"r\") (Field \"x\"))\n(addr (Expr \"&(r->y)\") (Expr \"r\") (Field \"y\"))\n(load (Expr \"*xp\") (Expr \"xp\"))\n(load (Expr \"*yp\") (Expr \"yp\"))\n\n(func (Func \"f\") (Expr \"i\") (Type \"int\") (Type \"int\"))\n;; statements\n(func-stmt (Func \"f\") (Stmt \"struct s *sp = malloc(sizeof(struct s))\"))\n(func-stmt (Func \"f\") (Stmt \"int *u = malloc(sizeof(int))\"))\n(func-stmt (Func \"f\") (Stmt \"int *v = malloc(sizeof(int))\"))\n(func-stmt (Func \"f\") (Stmt \"*u = i\"))\n(func-stmt (Func \"f\") (Stmt \"*v = i\"))\n(func-stmt (Func \"f\") (Stmt \"*sp = (struct s){u, v}\"))\n(func-stmt (Func \"f\") (Stmt \"swap(sp)\"))\n(func-stmt (Func \"f\") (Stmt \"int **zpp = &(sp->x)\"))\n(func-stmt (Func \"f\") (Stmt \"int *zp = *zpp\"))\n(func-stmt (Func \"f\") (Stmt \"return *zp\"))\n(assign (Stmt \"struct s *sp = malloc(sizeof(struct s))\") (Type \"struct s*\") (Expr \"sp\") (Expr \"malloc(sizeof(struct s))\"))\n(assign (Stmt \"int *u = malloc(sizeof(int))\") (Type \"int *\") (Expr \"u\") (Expr \"malloc(sizeof(int))\"))\n(assign (Stmt \"int *v = malloc(sizeof(int))\") (Type \"int *\") (Expr \"v\") (Expr \"malloc(sizeof(int))\"))\n(store (Stmt \"*u = i\") (Expr \"u\") (Expr \"i\"))\n(store (Stmt \"*v = i\") (Expr \"v\") (Expr \"i\"))\n(store (Stmt \"*sp = (struct s){u, v}\") (Expr \"sp\") (Expr \"(struct s){u, v}\"))\n(expr (Stmt \"swap(sp)\") (Expr \"swap(sp)\"))\n(assign (Stmt \"int **zpp = &(sp->x)\") (Type \"int **\") (Expr \"zpp\") (Expr \"&(sp->x)\"))\n(assign (Stmt \"int *zp = *zpp\") (Type \"int *\") (Expr \"zp\") (Expr \"*zpp\"))\n(return (Stmt \"return *zp\") (Expr \"*zp\"))\n;; expressions\n(malloc (Expr \"malloc(sizeof(struct s))\") (Type \"struct s\"))\n(malloc (Expr \"malloc(sizeof(int))\") (Type \"int\"))\n(struct-lit-field (Expr \"(struct s){u, v}\") (Field \"x\") (Expr \"u\"))\n(struct-lit-field (Expr \"(struct s){u, v}\") (Field \"y\") (Expr \"v\"))\n(call (Expr \"swap(sp)\") (Func \"swap\") (Expr \"sp\"))\n(addr (Expr \"&(sp->x)\") (Expr \"sp\") (Field \"x\"))\n(load (Expr \"*zpp\") (Expr \"zpp\"))\n(load (Expr \"*zp\") (Expr \"zp\"))\n\n;; a variable points to its allocation\n(function expr-points-to (ExprT) AllocT)\n(function ptr-points-to (AllocT) AllocT)\n\n;; If `v = malloc(...)`, then `v -> alloc[v]`.\n(rule (\n (assign s t1 v c)\n (malloc c t2)\n)(\n (union (expr-points-to v) (AllocVar v))\n))\n\n;; If `t v = e` and `e -> a`, then `v -> a`.\n(rule (\n (assign s t v e)\n (= (expr-points-to e) a)\n)(\n (union (expr-points-to v) a)\n))\n\n;; If `*v = u`, `v -> a`, and `u -> b`, then `a -> b`.\n(rule (\n (store s v u)\n (= (expr-points-to v) a)\n (= (expr-points-to u) b)\n)(\n (union (ptr-points-to a) b)\n))\n\n;; If `e.f -> a` then `e -> a`.\n(rule (\n (field ef e f)\n (= (expr-points-to ef) a)\n)(\n (union (expr-points-to e) a)\n))\n\n;; If `e -> a` then `e.f -> a`.\n(rule (\n (= (expr-points-to e) a)\n (field ef e f)\n)(\n (union (expr-points-to ef) a) \n))\n\n;; If `u -> a` and `a -> b`, then `&(u->f) -> b`.\n(rule (\n (= (expr-points-to u) a)\n (= (ptr-points-to a) b)\n (addr e u f)\n)(\n (union (expr-points-to e) b)\n))\n\n;; If `u -> a` and `&(u->f) -> b`, then `a -> b`.\n(rule (\n (= (expr-points-to u) a)\n (addr e u f)\n (= (expr-points-to e) b)\n)(\n (union (ptr-points-to a) b)\n))\n\n;; If `(struct t){..., x, ...}` and `x -> b`, then `(struct t){..., x, ...} -> b`.\n(rule (\n (struct-lit-field l f x)\n (= (expr-points-to x) b)\n)(\n (union (expr-points-to l) b) \n))\n\n;; If `f(t* x)`, `f(v)`, and `v -> a`, then `x -> a`.\n(rule (\n (func f x in out)\n (call e f v)\n (= (expr-points-to v) a)\n)(\n (union (expr-points-to x) a) \n))\n\n;; If `return u` in `f` and `u -> a`, then `f(z) -> a`.\n(rule (\n (call e f v)\n (func-stmt f s)\n (return s u)\n (= (expr-points-to u) a)\n)(\n (union (expr-points-to e) a) \n))\n\n;; store rule\n(rule (\n (load e u)\n (= (expr-points-to u) a)\n (= (ptr-points-to a) b)\n)(\n (union (expr-points-to e) b)\n))\n\n(run 40)\n\n(check (= (AllocVar (Expr \"v\")) (AllocVar (Expr \"u\"))))\n(check (!= (AllocVar (Expr \"v\")) (AllocVar (Expr \"sp\"))))\n\n(query-extract :variants 100 (AllocVar (Expr \"u\")))\n(query-extract :variants 100 (AllocVar (Expr \"sp\")))\n", + "unify": "(datatype Expr\n (Mul Expr Expr)\n (Var String)\n (Lit i64)\n)\n\n; Assume injectivity of Mul for unification\n(rule ((= (Mul a b) (Mul c d)))\n ((union a c)\n (union b d)))\n\n;; (relation False (i64))\n; If any Literal make equal to something it can't be, false is derived\n;(rule ((= (Lit i) (Lit j)) (!= i j))\n; ((False 0)))\n(rule ((= (Lit i) (Mul a b)))\n ((panic \"Literal cannot be equal to a product\")))\n\n(union (Mul (Var \"a\") (Var \"a\")) \n (Mul (Lit 1) (Lit 2)))\n\n\n(run 3)\n(check (= (Var \"a\") (Lit 1)))\n(check (= (Lit 2) (Lit 1)))\n; (check (False 0)) ;; this should fail because we don't want prove false", + "unstable-fn": "(datatype Math\n (Num i64)\n (Var String)\n (Add Math Math)\n (Mul Math Math))\n\n(rewrite (Mul (Num x) (Num y)) (Num (* x y)))\n\n(datatype MathList\n (Nil)\n (Cons Math MathList))\n\n(sort MathFn (UnstableFn (Math) Math))\n\n\n(function square (Math) Math)\n(rewrite (square x) (Mul x x))\n\n(let square-fn (unstable-fn \"square\" ))\n\n;; test that we can call a function\n(let squared-3 (unstable-app square-fn (Num 3)))\n(check (= squared-3 (square (Num 3))))\n\n;; test that we can apply a function to a list\n\n(function list-map-math (MathList MathFn) MathList)\n(rewrite (list-map-math (Nil) fn) (Nil))\n(rewrite (list-map-math (Cons x xs) fn) (Cons (unstable-app fn x) (list-map-math xs fn)))\n\n(let x (Cons (Num 1) (Cons (Num 2) (Cons (Num 3) (Nil)))))\n(let squared-x (list-map-math x square-fn))\n(run-schedule (saturate (run)))\n(check (= squared-x (Cons (Num 1) (Cons (Num 4) (Cons (Num 9) (Nil))))))\n\n;; Test that we can partially apply a function in a rewrite rule\n\n(function list-multiply-by (MathList Math) MathList)\n(rewrite (list-multiply-by l i) (list-map-math l (unstable-fn \"Mul\" i)))\n\n(let doubled-x (list-multiply-by x (Num 2)))\n(run-schedule (saturate (run)))\n(check (= doubled-x (Cons (Num 2) (Cons (Num 4) (Cons (Num 6) (Nil))))))\n\n;; Test we can define a higher order compose function\n\n(function composed-math (MathFn MathFn Math) Math)\n(rewrite (composed-math f g v) (unstable-app f (unstable-app g v)))\n\n(let square-of-double (unstable-fn \"composed-math\" square-fn (unstable-fn \"Mul\" (Num 2))))\n\n(let squared-doubled-x (list-map-math x square-of-double))\n(run-schedule (saturate (run)))\n(check (= squared-doubled-x (Cons (Num 4) (Cons (Num 16) (Cons (Num 36) (Nil))))))\n\n\n;; See that it supports primitive values as well\n(sort i64Fun (UnstableFn (i64) i64))\n\n(function composed-i64-math (MathFn i64Fun i64) Math)\n(rewrite (composed-i64-math f g v) (unstable-app f (Num (unstable-app g v))))\n\n(let res (composed-i64-math square-fn (unstable-fn \"*\" 2) 4))\n(run-schedule (saturate (run)))\n(check (= res (Num 64)))\n\n;; Verify that function parsing works with a function with no args\n(sort TestNullaryFunction (UnstableFn () Math))\n;; Verify that we know the type of a function based on the string name\n(extract (unstable-fn \"square\"))\n", + "until": "; A simple group\n(datatype G)\n(function IConst () G)\n(let I (IConst))\n(function AConst () G)\n(let A (AConst))\n(function BConst () G)\n(let B (BConst))\n\n(function g* (G G) G)\n(function inv (G) G)\n(birewrite (g* (g* a b) c) (g* a (g* b c))) ; assoc\n(rewrite (g* I a) a) ; idl\n(rewrite (g* a I) a) ; idr\n\n; A is cyclic of period 4\n(rewrite (g* A (g* A (g* A A))) I)\n\n(let A2 (g* A A))\n(let A4 (g* A2 A2))\n(let A8 (g* A4 A4))\n\n; non terminating rule\n(relation allgs (G))\n(rule ((allgs x)) ((allgs (g* B x))))\n(allgs A)\n\n; if you remove :until, this will take a very long time\n(run 10000 :until (= A8 I))\n(check (= A8 I))\n(check (!= B A))\n(check (!= I A))\n; If you need multiple stop conditions, consider using a (relation relation stop (unit))\n; With rules filling it in with different stop conditions of interest.\n", + "vec": "(sort IVec (Vec i64))\n\n; Test vec-of\n(check (= (vec-of 1 2) (vec-push (vec-push (vec-empty) 1) 2)))\n\n; Test vec-append\n(check (= (vec-append (vec-of 1 2) (vec-of 3 4)) (vec-of 1 2 3 4)))\n\n; Test vec-pop\n(check (= (vec-pop (vec-of 1 2 3)) (vec-of 1 2)))\n\n; Test vec-not-contains\n(check (vec-not-contains (vec-of 1 2 3) 4))\n\n; Test vec-contains\n(check (vec-contains (vec-of 1 2 3) 2))\n\n; Test length\n(check (= (vec-length (vec-of 1 2 3)) 3))\n\n; Test vec-get\n(check (= (vec-get (vec-of 1 2 3) 1) 2))\n\n; Test vec-set\n(check (= (vec-set (vec-of 1 2 3) 1 4) (vec-of 1 4 3)))\n" +} \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 00000000..a5bb3b1d --- /dev/null +++ b/index.html @@ -0,0 +1,515 @@ + + + + + + egglog demo + + + + + + + + + + + + + + + + +
+
+
+ + + + + +

+ + + + +
+ + GitHub Repo +
+
+ + Main Branch Documentation +
+
+ +
+ + +
+ +
+
Click "Run" to run code
+
+ + +
+
+
+
+ + + diff --git a/lzma-url.mjs b/lzma-url.mjs new file mode 100644 index 00000000..93fd7dd0 --- /dev/null +++ b/lzma-url.mjs @@ -0,0 +1,3214 @@ +/* +The LZMA impementation is taken from https://npm.is/lzma-js, converted to an ES module and with some features stripped off (e.g. async mode, worker support) + +Here's the according MIT license: + +© 2016 Nathan Rugg + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +import * as base64 from './base64.mjs' + +const __4294967296 = 4294967296, + N1_longLit = [4294967295, -__4294967296], + MIN_VALUE = [0, -9223372036854775808], + P0_longLit = [0, 0], + P1_longLit = [1, 0] + +function add(a, b) { + return create(a[0] + b[0], a[1] + b[1]) +} + +function initDim(len) { + // NOTE: This is MUCH faster than "initDim(len)" in newer versions of v8 (starting with Node.js 0.11.15, which uses v8 3.28.73). + var a = [] + a[len - 1] = undefined + return a +} +function and(a, b) { + return makeFromBits( + ~~Math.max(Math.min(a[1] / __4294967296, 2147483647), -2147483648) & + ~~Math.max(Math.min(b[1] / __4294967296, 2147483647), -2147483648), + lowBits_0(a) & lowBits_0(b) + ) +} +function compare(a, b) { + var nega, negb + if (a[0] == b[0] && a[1] == b[1]) { + return 0 + } + nega = a[1] < 0 + negb = b[1] < 0 + if (nega && !negb) { + return -1 + } + if (!nega && negb) { + return 1 + } + if (sub(a, b)[1] < 0) { + return -1 + } + return 1 +} + +function create(valueLow, valueHigh) { + var diffHigh, diffLow + valueHigh %= 1.8446744073709552e19 + valueLow %= 1.8446744073709552e19 + diffHigh = valueHigh % __4294967296 + diffLow = Math.floor(valueLow / __4294967296) * __4294967296 + valueHigh = valueHigh - diffHigh + diffLow + valueLow = valueLow - diffLow + diffHigh + while (valueLow < 0) { + valueLow += __4294967296 + valueHigh -= __4294967296 + } + while (valueLow > 4294967295) { + valueLow -= __4294967296 + valueHigh += __4294967296 + } + valueHigh = valueHigh % 1.8446744073709552e19 + while (valueHigh > 9223372032559808512) { + valueHigh -= 1.8446744073709552e19 + } + while (valueHigh < -9223372036854775808) { + valueHigh += 1.8446744073709552e19 + } + return [valueLow, valueHigh] +} +function eq(a, b) { + return a[0] == b[0] && a[1] == b[1] +} +function fromInt(value) { + if (value >= 0) { + return [value, 0] + } else { + return [value + __4294967296, -__4294967296] + } +} + +function lowBits_0(a) { + if (a[0] >= 2147483648) { + return ~~Math.max(Math.min(a[0] - __4294967296, 2147483647), -2147483648) + } else { + return ~~Math.max(Math.min(a[0], 2147483647), -2147483648) + } +} +function makeFromBits(highBits, lowBits) { + var high, low + high = highBits * __4294967296 + low = lowBits + if (lowBits < 0) { + low += __4294967296 + } + return [low, high] +} + +function pwrAsDouble(n) { + if (n <= 30) { + return 1 << n + } else { + return pwrAsDouble(30) * pwrAsDouble(n - 30) + } +} + +function shl(a, n) { + var diff, newHigh, newLow, twoToN + n &= 63 + if (eq(a, MIN_VALUE)) { + if (!n) { + return a + } + return P0_longLit + } + if (a[1] < 0) { + throw new Error('Neg') + } + twoToN = pwrAsDouble(n) + newHigh = (a[1] * twoToN) % 1.8446744073709552e19 + newLow = a[0] * twoToN + diff = newLow - (newLow % __4294967296) + newHigh += diff + newLow -= diff + if (newHigh >= 9223372036854775807) { + newHigh -= 1.8446744073709552e19 + } + return [newLow, newHigh] +} + +function shr(a, n) { + var shiftFact + n &= 63 + shiftFact = pwrAsDouble(n) + return create(Math.floor(a[0] / shiftFact), a[1] / shiftFact) +} + +function shru(a, n) { + var sr + n &= 63 + sr = shr(a, n) + if (a[1] < 0) { + sr = add(sr, shl([2, 0], 63 - n)) + } + return sr +} +function sub(a, b) { + return create(a[0] - b[0], a[1] - b[1]) +} + +function $ByteArrayInputStream(this$static, buf) { + this$static.buf = buf + this$static.pos = 0 + this$static.count = buf.length + return this$static +} +function $read(this$static) { + if (this$static.pos >= this$static.count) return -1 + return this$static.buf[this$static.pos++] & 255 +} +function $read_0(this$static, buf, off, len) { + if (this$static.pos >= this$static.count) return -1 + len = Math.min(len, this$static.count - this$static.pos) + arraycopy(this$static.buf, this$static.pos, buf, off, len) + this$static.pos += len + return len +} +function $ByteArrayOutputStream(this$static) { + this$static.buf = initDim(32) + this$static.count = 0 + return this$static +} + +function $toByteArray(this$static) { + var data = this$static.buf + data.length = this$static.count + return data +} +function $write(this$static, b) { + this$static.buf[this$static.count++] = (b << 24) >> 24 +} +function $write_0(this$static, buf, off, len) { + arraycopy(buf, off, this$static.buf, this$static.count, len) + this$static.count += len +} +function $getChars(this$static, srcBegin, srcEnd, dst, dstBegin) { + var srcIdx + for (srcIdx = srcBegin; srcIdx < srcEnd; ++srcIdx) { + dst[dstBegin++] = this$static.charCodeAt(srcIdx) + } +} +function arraycopy(src, srcOfs, dest, destOfs, len) { + for (var i = 0; i < len; ++i) { + dest[destOfs + i] = src[srcOfs + i] + } +} +function $configure(this$static, encoder) { + $SetDictionarySize_0(encoder, 1 << this$static.s) + encoder._numFastBytes = this$static.f + $SetMatchFinder(encoder, this$static.m) + + // lc is always 3 + // lp is always 0 + // pb is always 2 + encoder._numLiteralPosStateBits = 0 + encoder._numLiteralContextBits = 3 + encoder._posStateBits = 2 + encoder._posStateMask = 3 +} + +function $init(this$static, input, output, length_0, mode, enableEndMark) { + var encoder, i + if (compare(length_0, N1_longLit) < 0) + throw new Error('invalid length ' + length_0) + this$static.length_0 = length_0 + encoder = $Encoder({}) + $configure(mode, encoder) + encoder._writeEndMark = enableEndMark + $WriteCoderProperties(encoder, output) + for (i = 0; i < 64; i += 8) $write(output, lowBits_0(shr(length_0, i)) & 255) + this$static.chunker = + ((encoder._needReleaseMFStream = 0), + ((encoder._inStream = input), + (encoder._finished = 0), + $Create_2(encoder), + (encoder._rangeEncoder.Stream = output), + $Init_4(encoder), + $FillDistancesPrices(encoder), + $FillAlignPrices(encoder), + (encoder._lenEncoder._tableSize = encoder._numFastBytes + 1 - 2), + $UpdateTables(encoder._lenEncoder, 1 << encoder._posStateBits), + (encoder._repMatchLenEncoder._tableSize = encoder._numFastBytes + 1 - 2), + $UpdateTables(encoder._repMatchLenEncoder, 1 << encoder._posStateBits), + (encoder.nowPos64 = P0_longLit), + undefined), + $Chunker_0({}, encoder)) +} + +function $LZMAByteArrayCompressor(this$static, data, mode, enableEndMark) { + this$static.output = $ByteArrayOutputStream({}) + $init( + this$static, + $ByteArrayInputStream({}, data), + this$static.output, + fromInt(data.length), + mode, + enableEndMark + ) + return this$static +} +function $init_0(this$static, input, output) { + var decoder, + hex_length = '', + i, + properties = [], + r, + tmp_length + + for (i = 0; i < 5; ++i) { + r = $read(input) + if (r == -1) throw new Error('truncated input') + properties[i] = (r << 24) >> 24 + } + + decoder = $Decoder({}) + if (!$SetDecoderProperties(decoder, properties)) { + throw new Error('corrupted input') + } + for (i = 0; i < 64; i += 8) { + r = $read(input) + if (r == -1) throw new Error('truncated input') + r = r.toString(16) + if (r.length == 1) r = '0' + r + hex_length = r + '' + hex_length + } + + // Was the length set in the header (if it was compressed from a stream, the length is all f"s). + if (/^0+$|^f+$/i.test(hex_length)) { + // The length is unknown, so set to -1. + this$static.length_0 = N1_longLit + } else { + // NOTE: If there is a problem with the decoder because of the length, you can always set the length to -1 (N1_longLit) which means unknown. + tmp_length = parseInt(hex_length, 16) + // If the length is too long to handle, just set it to unknown. + if (tmp_length > 4294967295) { + this$static.length_0 = N1_longLit + } else { + this$static.length_0 = fromInt(tmp_length) + } + } + + this$static.chunker = $CodeInChunks( + decoder, + input, + output, + this$static.length_0 + ) +} + +function $LZMAByteArrayDecompressor(this$static, data) { + this$static.output = $ByteArrayOutputStream({}) + $init_0(this$static, $ByteArrayInputStream({}, data), this$static.output) + return this$static +} +function $Create_4(this$static, keepSizeBefore, keepSizeAfter, keepSizeReserv) { + var blockSize + this$static._keepSizeBefore = keepSizeBefore + this$static._keepSizeAfter = keepSizeAfter + blockSize = keepSizeBefore + keepSizeAfter + keepSizeReserv + if (this$static._bufferBase == null || this$static._blockSize != blockSize) { + this$static._bufferBase = null + this$static._blockSize = blockSize + this$static._bufferBase = initDim(this$static._blockSize) + } + this$static._pointerToLastSafePosition = + this$static._blockSize - keepSizeAfter +} + +function $GetIndexByte(this$static, index) { + return this$static._bufferBase[ + this$static._bufferOffset + this$static._pos + index + ] +} + +function $GetMatchLen(this$static, index, distance, limit) { + var i, pby + if (this$static._streamEndWasReached) { + if (this$static._pos + index + limit > this$static._streamPos) { + limit = this$static._streamPos - (this$static._pos + index) + } + } + ++distance + pby = this$static._bufferOffset + this$static._pos + index + for ( + i = 0; + i < limit && + this$static._bufferBase[pby + i] == + this$static._bufferBase[pby + i - distance]; + ++i + ) {} + return i +} + +function $GetNumAvailableBytes(this$static) { + return this$static._streamPos - this$static._pos +} + +function $MoveBlock(this$static) { + var i, numBytes, offset + offset = + this$static._bufferOffset + this$static._pos - this$static._keepSizeBefore + if (offset > 0) { + --offset + } + numBytes = this$static._bufferOffset + this$static._streamPos - offset + for (i = 0; i < numBytes; ++i) { + this$static._bufferBase[i] = this$static._bufferBase[offset + i] + } + this$static._bufferOffset -= offset +} + +function $MovePos_1(this$static) { + var pointerToPostion + ++this$static._pos + if (this$static._pos > this$static._posLimit) { + pointerToPostion = this$static._bufferOffset + this$static._pos + if (pointerToPostion > this$static._pointerToLastSafePosition) { + $MoveBlock(this$static) + } + $ReadBlock(this$static) + } +} + +function $ReadBlock(this$static) { + var numReadBytes, pointerToPostion, size + if (this$static._streamEndWasReached) return + while (1) { + size = + -this$static._bufferOffset + + this$static._blockSize - + this$static._streamPos + if (!size) return + numReadBytes = $read_0( + this$static._stream, + this$static._bufferBase, + this$static._bufferOffset + this$static._streamPos, + size + ) + if (numReadBytes == -1) { + this$static._posLimit = this$static._streamPos + pointerToPostion = this$static._bufferOffset + this$static._posLimit + if (pointerToPostion > this$static._pointerToLastSafePosition) { + this$static._posLimit = + this$static._pointerToLastSafePosition - this$static._bufferOffset + } + this$static._streamEndWasReached = 1 + return + } + this$static._streamPos += numReadBytes + if ( + this$static._streamPos >= + this$static._pos + this$static._keepSizeAfter + ) { + this$static._posLimit = + this$static._streamPos - this$static._keepSizeAfter + } + } +} + +function $ReduceOffsets(this$static, subValue) { + this$static._bufferOffset += subValue + this$static._posLimit -= subValue + this$static._pos -= subValue + this$static._streamPos -= subValue +} + +var CrcTable = (function() { + var i, + j, + r, + CrcTable = [] + for (i = 0; i < 256; ++i) { + r = i + for (j = 0; j < 8; ++j) + if ((r & 1) != 0) { + r = (r >>> 1) ^ -306674912 + } else { + r >>>= 1 + } + CrcTable[i] = r + } + return CrcTable +})() + +function $Create_3( + this$static, + historySize, + keepAddBufferBefore, + matchMaxLen, + keepAddBufferAfter +) { + var cyclicBufferSize, hs, windowReservSize + if (historySize < 1073741567) { + this$static._cutValue = 16 + (matchMaxLen >> 1) + windowReservSize = + ~~( + (historySize + keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / + 2 + ) + 256 + $Create_4( + this$static, + historySize + keepAddBufferBefore, + matchMaxLen + keepAddBufferAfter, + windowReservSize + ) + this$static._matchMaxLen = matchMaxLen + cyclicBufferSize = historySize + 1 + if (this$static._cyclicBufferSize != cyclicBufferSize) { + this$static._son = initDim( + (this$static._cyclicBufferSize = cyclicBufferSize) * 2 + ) + } + + hs = 65536 + if (this$static.HASH_ARRAY) { + hs = historySize - 1 + hs |= hs >> 1 + hs |= hs >> 2 + hs |= hs >> 4 + hs |= hs >> 8 + hs >>= 1 + hs |= 65535 + if (hs > 16777216) hs >>= 1 + this$static._hashMask = hs + ++hs + hs += this$static.kFixHashSize + } + + if (hs != this$static._hashSizeSum) { + this$static._hash = initDim((this$static._hashSizeSum = hs)) + } + } +} + +function $GetMatches(this$static, distances) { + var count, + cur, + curMatch, + curMatch2, + curMatch3, + cyclicPos, + delta, + hash2Value, + hash3Value, + hashValue, + len, + len0, + len1, + lenLimit, + matchMinPos, + maxLen, + offset, + pby1, + ptr0, + ptr1, + temp + if (this$static._pos + this$static._matchMaxLen <= this$static._streamPos) { + lenLimit = this$static._matchMaxLen + } else { + lenLimit = this$static._streamPos - this$static._pos + if (lenLimit < this$static.kMinMatchCheck) { + $MovePos_0(this$static) + return 0 + } + } + offset = 0 + matchMinPos = + this$static._pos > this$static._cyclicBufferSize + ? this$static._pos - this$static._cyclicBufferSize + : 0 + cur = this$static._bufferOffset + this$static._pos + maxLen = 1 + hash2Value = 0 + hash3Value = 0 + if (this$static.HASH_ARRAY) { + temp = + CrcTable[this$static._bufferBase[cur] & 255] ^ + (this$static._bufferBase[cur + 1] & 255) + hash2Value = temp & 1023 + temp ^= (this$static._bufferBase[cur + 2] & 255) << 8 + hash3Value = temp & 65535 + hashValue = + (temp ^ (CrcTable[this$static._bufferBase[cur + 3] & 255] << 5)) & + this$static._hashMask + } else { + hashValue = + (this$static._bufferBase[cur] & 255) ^ + ((this$static._bufferBase[cur + 1] & 255) << 8) + } + + curMatch = this$static._hash[this$static.kFixHashSize + hashValue] || 0 + if (this$static.HASH_ARRAY) { + curMatch2 = this$static._hash[hash2Value] || 0 + curMatch3 = this$static._hash[1024 + hash3Value] || 0 + this$static._hash[hash2Value] = this$static._pos + this$static._hash[1024 + hash3Value] = this$static._pos + if (curMatch2 > matchMinPos) { + if ( + this$static._bufferBase[this$static._bufferOffset + curMatch2] == + this$static._bufferBase[cur] + ) { + distances[offset++] = maxLen = 2 + distances[offset++] = this$static._pos - curMatch2 - 1 + } + } + if (curMatch3 > matchMinPos) { + if ( + this$static._bufferBase[this$static._bufferOffset + curMatch3] == + this$static._bufferBase[cur] + ) { + if (curMatch3 == curMatch2) { + offset -= 2 + } + distances[offset++] = maxLen = 3 + distances[offset++] = this$static._pos - curMatch3 - 1 + curMatch2 = curMatch3 + } + } + if (offset != 0 && curMatch2 == curMatch) { + offset -= 2 + maxLen = 1 + } + } + this$static._hash[this$static.kFixHashSize + hashValue] = this$static._pos + ptr0 = (this$static._cyclicBufferPos << 1) + 1 + ptr1 = this$static._cyclicBufferPos << 1 + len0 = len1 = this$static.kNumHashDirectBytes + if (this$static.kNumHashDirectBytes != 0) { + if (curMatch > matchMinPos) { + if ( + this$static._bufferBase[ + this$static._bufferOffset + curMatch + this$static.kNumHashDirectBytes + ] != this$static._bufferBase[cur + this$static.kNumHashDirectBytes] + ) { + distances[offset++] = maxLen = this$static.kNumHashDirectBytes + distances[offset++] = this$static._pos - curMatch - 1 + } + } + } + count = this$static._cutValue + while (1) { + if (curMatch <= matchMinPos || count-- == 0) { + this$static._son[ptr0] = this$static._son[ptr1] = 0 + break + } + delta = this$static._pos - curMatch + cyclicPos = + (delta <= this$static._cyclicBufferPos + ? this$static._cyclicBufferPos - delta + : this$static._cyclicBufferPos - + delta + + this$static._cyclicBufferSize) << 1 + pby1 = this$static._bufferOffset + curMatch + len = len0 < len1 ? len0 : len1 + if ( + this$static._bufferBase[pby1 + len] == this$static._bufferBase[cur + len] + ) { + while (++len != lenLimit) { + if ( + this$static._bufferBase[pby1 + len] != + this$static._bufferBase[cur + len] + ) { + break + } + } + if (maxLen < len) { + distances[offset++] = maxLen = len + distances[offset++] = delta - 1 + if (len == lenLimit) { + this$static._son[ptr1] = this$static._son[cyclicPos] + this$static._son[ptr0] = this$static._son[cyclicPos + 1] + break + } + } + } + if ( + (this$static._bufferBase[pby1 + len] & 255) < + (this$static._bufferBase[cur + len] & 255) + ) { + this$static._son[ptr1] = curMatch + ptr1 = cyclicPos + 1 + curMatch = this$static._son[ptr1] + len1 = len + } else { + this$static._son[ptr0] = curMatch + ptr0 = cyclicPos + curMatch = this$static._son[ptr0] + len0 = len + } + } + $MovePos_0(this$static) + return offset +} + +function $Init_5(this$static) { + this$static._bufferOffset = 0 + this$static._pos = 0 + this$static._streamPos = 0 + this$static._streamEndWasReached = 0 + $ReadBlock(this$static) + this$static._cyclicBufferPos = 0 + $ReduceOffsets(this$static, -1) +} + +function $MovePos_0(this$static) { + var subValue + if (++this$static._cyclicBufferPos >= this$static._cyclicBufferSize) { + this$static._cyclicBufferPos = 0 + } + $MovePos_1(this$static) + if (this$static._pos == 1073741823) { + subValue = this$static._pos - this$static._cyclicBufferSize + $NormalizeLinks( + this$static._son, + this$static._cyclicBufferSize * 2, + subValue + ) + $NormalizeLinks(this$static._hash, this$static._hashSizeSum, subValue) + $ReduceOffsets(this$static, subValue) + } +} + +// NOTE: This is only called after reading one whole gigabyte. +function $NormalizeLinks(items, numItems, subValue) { + var i, value + for (i = 0; i < numItems; ++i) { + value = items[i] || 0 + if (value <= subValue) { + value = 0 + } else { + value -= subValue + } + items[i] = value + } +} + +function $SetType(this$static, numHashBytes) { + this$static.HASH_ARRAY = numHashBytes > 2 + if (this$static.HASH_ARRAY) { + this$static.kNumHashDirectBytes = 0 + this$static.kMinMatchCheck = 4 + this$static.kFixHashSize = 66560 + } else { + this$static.kNumHashDirectBytes = 2 + this$static.kMinMatchCheck = 3 + this$static.kFixHashSize = 0 + } +} + +function $Skip(this$static, num) { + var count, + cur, + curMatch, + cyclicPos, + delta, + hash2Value, + hash3Value, + hashValue, + len, + len0, + len1, + lenLimit, + matchMinPos, + pby1, + ptr0, + ptr1, + temp + do { + if (this$static._pos + this$static._matchMaxLen <= this$static._streamPos) { + lenLimit = this$static._matchMaxLen + } else { + lenLimit = this$static._streamPos - this$static._pos + if (lenLimit < this$static.kMinMatchCheck) { + $MovePos_0(this$static) + continue + } + } + matchMinPos = + this$static._pos > this$static._cyclicBufferSize + ? this$static._pos - this$static._cyclicBufferSize + : 0 + cur = this$static._bufferOffset + this$static._pos + if (this$static.HASH_ARRAY) { + temp = + CrcTable[this$static._bufferBase[cur] & 255] ^ + (this$static._bufferBase[cur + 1] & 255) + hash2Value = temp & 1023 + this$static._hash[hash2Value] = this$static._pos + temp ^= (this$static._bufferBase[cur + 2] & 255) << 8 + hash3Value = temp & 65535 + this$static._hash[1024 + hash3Value] = this$static._pos + hashValue = + (temp ^ (CrcTable[this$static._bufferBase[cur + 3] & 255] << 5)) & + this$static._hashMask + } else { + hashValue = + (this$static._bufferBase[cur] & 255) ^ + ((this$static._bufferBase[cur + 1] & 255) << 8) + } + curMatch = this$static._hash[this$static.kFixHashSize + hashValue] + this$static._hash[this$static.kFixHashSize + hashValue] = this$static._pos + ptr0 = (this$static._cyclicBufferPos << 1) + 1 + ptr1 = this$static._cyclicBufferPos << 1 + len0 = len1 = this$static.kNumHashDirectBytes + count = this$static._cutValue + while (1) { + if (curMatch <= matchMinPos || count-- == 0) { + this$static._son[ptr0] = this$static._son[ptr1] = 0 + break + } + delta = this$static._pos - curMatch + cyclicPos = + (delta <= this$static._cyclicBufferPos + ? this$static._cyclicBufferPos - delta + : this$static._cyclicBufferPos - + delta + + this$static._cyclicBufferSize) << 1 + pby1 = this$static._bufferOffset + curMatch + len = len0 < len1 ? len0 : len1 + if ( + this$static._bufferBase[pby1 + len] == + this$static._bufferBase[cur + len] + ) { + while (++len != lenLimit) { + if ( + this$static._bufferBase[pby1 + len] != + this$static._bufferBase[cur + len] + ) { + break + } + } + if (len == lenLimit) { + this$static._son[ptr1] = this$static._son[cyclicPos] + this$static._son[ptr0] = this$static._son[cyclicPos + 1] + break + } + } + if ( + (this$static._bufferBase[pby1 + len] & 255) < + (this$static._bufferBase[cur + len] & 255) + ) { + this$static._son[ptr1] = curMatch + ptr1 = cyclicPos + 1 + curMatch = this$static._son[ptr1] + len1 = len + } else { + this$static._son[ptr0] = curMatch + ptr0 = cyclicPos + curMatch = this$static._son[ptr0] + len0 = len + } + } + $MovePos_0(this$static) + } while (--num != 0) +} +function $CopyBlock(this$static, distance, len) { + var pos = this$static._pos - distance - 1 + if (pos < 0) { + pos += this$static._windowSize + } + for (; len != 0; --len) { + if (pos >= this$static._windowSize) { + pos = 0 + } + this$static._buffer[this$static._pos++] = this$static._buffer[pos++] + if (this$static._pos >= this$static._windowSize) { + $Flush_0(this$static) + } + } +} + +function $Create_5(this$static, windowSize) { + if (this$static._buffer == null || this$static._windowSize != windowSize) { + this$static._buffer = initDim(windowSize) + } + this$static._windowSize = windowSize + this$static._pos = 0 + this$static._streamPos = 0 +} + +function $Flush_0(this$static) { + var size = this$static._pos - this$static._streamPos + if (!size) { + return + } + $write_0( + this$static._stream, + this$static._buffer, + this$static._streamPos, + size + ) + if (this$static._pos >= this$static._windowSize) { + this$static._pos = 0 + } + this$static._streamPos = this$static._pos +} + +function $GetByte(this$static, distance) { + var pos = this$static._pos - distance - 1 + if (pos < 0) { + pos += this$static._windowSize + } + return this$static._buffer[pos] +} + +function $PutByte(this$static, b) { + this$static._buffer[this$static._pos++] = b + if (this$static._pos >= this$static._windowSize) { + $Flush_0(this$static) + } +} + +function $ReleaseStream(this$static) { + $Flush_0(this$static) + this$static._stream = null +} +function GetLenToPosState(len) { + len -= 2 + if (len < 4) { + return len + } + return 3 +} + +function StateUpdateChar(index) { + if (index < 4) { + return 0 + } + if (index < 10) { + return index - 3 + } + return index - 6 +} +function $Chunker_0(this$static, encoder) { + this$static.encoder = encoder + this$static.decoder = null + this$static.alive = 1 + return this$static +} +function $Chunker(this$static, decoder) { + this$static.decoder = decoder + this$static.encoder = null + this$static.alive = 1 + return this$static +} +function $processChunk(this$static) { + if (!this$static.alive) { + throw new Error('bad state') + } + + if (this$static.encoder) { + $processEncoderChunk(this$static) + } else { + $processDecoderChunk(this$static) + } + + return this$static.alive +} +function $processDecoderChunk(this$static) { + var result = $CodeOneChunk(this$static.decoder) + if (result == -1) { + throw new Error('corrupted input') + } + this$static.inBytesProcessed = N1_longLit + this$static.outBytesProcessed = this$static.decoder.nowPos64 + if ( + result || + (compare(this$static.decoder.outSize, P0_longLit) >= 0 && + compare(this$static.decoder.nowPos64, this$static.decoder.outSize) >= 0) + ) { + $Flush_0(this$static.decoder.m_OutWindow) + $ReleaseStream(this$static.decoder.m_OutWindow) + this$static.decoder.m_RangeDecoder.Stream = null + this$static.alive = 0 + } +} +function $processEncoderChunk(this$static) { + $CodeOneBlock( + this$static.encoder, + this$static.encoder.processedInSize, + this$static.encoder.processedOutSize, + this$static.encoder.finished + ) + this$static.inBytesProcessed = this$static.encoder.processedInSize[0] + if (this$static.encoder.finished[0]) { + $ReleaseStreams(this$static.encoder) + this$static.alive = 0 + } +} +function $CodeInChunks(this$static, inStream, outStream, outSize) { + this$static.m_RangeDecoder.Stream = inStream + $ReleaseStream(this$static.m_OutWindow) + this$static.m_OutWindow._stream = outStream + $Init_1(this$static) + this$static.state = 0 + this$static.rep0 = 0 + this$static.rep1 = 0 + this$static.rep2 = 0 + this$static.rep3 = 0 + this$static.outSize = outSize + this$static.nowPos64 = P0_longLit + this$static.prevByte = 0 + return $Chunker({}, this$static) +} + +function $CodeOneChunk(this$static) { + var decoder2, distance, len, numDirectBits, posSlot, posState + posState = lowBits_0(this$static.nowPos64) & this$static.m_PosStateMask + if ( + !$DecodeBit( + this$static.m_RangeDecoder, + this$static.m_IsMatchDecoders, + (this$static.state << 4) + posState + ) + ) { + decoder2 = $GetDecoder( + this$static.m_LiteralDecoder, + lowBits_0(this$static.nowPos64), + this$static.prevByte + ) + if (this$static.state < 7) { + this$static.prevByte = $DecodeNormal(decoder2, this$static.m_RangeDecoder) + } else { + this$static.prevByte = $DecodeWithMatchByte( + decoder2, + this$static.m_RangeDecoder, + $GetByte(this$static.m_OutWindow, this$static.rep0) + ) + } + $PutByte(this$static.m_OutWindow, this$static.prevByte) + this$static.state = StateUpdateChar(this$static.state) + this$static.nowPos64 = add(this$static.nowPos64, P1_longLit) + } else { + if ( + $DecodeBit( + this$static.m_RangeDecoder, + this$static.m_IsRepDecoders, + this$static.state + ) + ) { + len = 0 + if ( + !$DecodeBit( + this$static.m_RangeDecoder, + this$static.m_IsRepG0Decoders, + this$static.state + ) + ) { + if ( + !$DecodeBit( + this$static.m_RangeDecoder, + this$static.m_IsRep0LongDecoders, + (this$static.state << 4) + posState + ) + ) { + this$static.state = this$static.state < 7 ? 9 : 11 + len = 1 + } + } else { + if ( + !$DecodeBit( + this$static.m_RangeDecoder, + this$static.m_IsRepG1Decoders, + this$static.state + ) + ) { + distance = this$static.rep1 + } else { + if ( + !$DecodeBit( + this$static.m_RangeDecoder, + this$static.m_IsRepG2Decoders, + this$static.state + ) + ) { + distance = this$static.rep2 + } else { + distance = this$static.rep3 + this$static.rep3 = this$static.rep2 + } + this$static.rep2 = this$static.rep1 + } + this$static.rep1 = this$static.rep0 + this$static.rep0 = distance + } + if (!len) { + len = + $Decode( + this$static.m_RepLenDecoder, + this$static.m_RangeDecoder, + posState + ) + 2 + this$static.state = this$static.state < 7 ? 8 : 11 + } + } else { + this$static.rep3 = this$static.rep2 + this$static.rep2 = this$static.rep1 + this$static.rep1 = this$static.rep0 + len = + 2 + + $Decode(this$static.m_LenDecoder, this$static.m_RangeDecoder, posState) + this$static.state = this$static.state < 7 ? 7 : 10 + posSlot = $Decode_0( + this$static.m_PosSlotDecoder[GetLenToPosState(len)], + this$static.m_RangeDecoder + ) + if (posSlot >= 4) { + numDirectBits = (posSlot >> 1) - 1 + this$static.rep0 = (2 | (posSlot & 1)) << numDirectBits + if (posSlot < 14) { + this$static.rep0 += ReverseDecode( + this$static.m_PosDecoders, + this$static.rep0 - posSlot - 1, + this$static.m_RangeDecoder, + numDirectBits + ) + } else { + this$static.rep0 += + $DecodeDirectBits(this$static.m_RangeDecoder, numDirectBits - 4) << + 4 + this$static.rep0 += $ReverseDecode( + this$static.m_PosAlignDecoder, + this$static.m_RangeDecoder + ) + if (this$static.rep0 < 0) { + if (this$static.rep0 == -1) { + return 1 + } + return -1 + } + } + } else this$static.rep0 = posSlot + } + if ( + compare(fromInt(this$static.rep0), this$static.nowPos64) >= 0 || + this$static.rep0 >= this$static.m_DictionarySizeCheck + ) { + return -1 + } + $CopyBlock(this$static.m_OutWindow, this$static.rep0, len) + this$static.nowPos64 = add(this$static.nowPos64, fromInt(len)) + this$static.prevByte = $GetByte(this$static.m_OutWindow, 0) + } + return 0 +} + +function $Decoder(this$static) { + this$static.m_OutWindow = {} + this$static.m_RangeDecoder = {} + this$static.m_IsMatchDecoders = initDim(192) + this$static.m_IsRepDecoders = initDim(12) + this$static.m_IsRepG0Decoders = initDim(12) + this$static.m_IsRepG1Decoders = initDim(12) + this$static.m_IsRepG2Decoders = initDim(12) + this$static.m_IsRep0LongDecoders = initDim(192) + this$static.m_PosSlotDecoder = initDim(4) + this$static.m_PosDecoders = initDim(114) + this$static.m_PosAlignDecoder = $BitTreeDecoder({}, 4) + this$static.m_LenDecoder = $Decoder$LenDecoder({}) + this$static.m_RepLenDecoder = $Decoder$LenDecoder({}) + this$static.m_LiteralDecoder = {} + for (var i = 0; i < 4; ++i) { + this$static.m_PosSlotDecoder[i] = $BitTreeDecoder({}, 6) + } + return this$static +} + +function $Init_1(this$static) { + this$static.m_OutWindow._streamPos = 0 + this$static.m_OutWindow._pos = 0 + InitBitModels(this$static.m_IsMatchDecoders) + InitBitModels(this$static.m_IsRep0LongDecoders) + InitBitModels(this$static.m_IsRepDecoders) + InitBitModels(this$static.m_IsRepG0Decoders) + InitBitModels(this$static.m_IsRepG1Decoders) + InitBitModels(this$static.m_IsRepG2Decoders) + InitBitModels(this$static.m_PosDecoders) + $Init_0(this$static.m_LiteralDecoder) + for (var i = 0; i < 4; ++i) { + InitBitModels(this$static.m_PosSlotDecoder[i].Models) + } + $Init(this$static.m_LenDecoder) + $Init(this$static.m_RepLenDecoder) + InitBitModels(this$static.m_PosAlignDecoder.Models) + $Init_8(this$static.m_RangeDecoder) +} + +function $SetDecoderProperties(this$static, properties) { + var dictionarySize, i, lc, lp, pb, remainder, val + if (properties.length < 5) return 0 + val = properties[0] & 255 + lc = val % 9 + remainder = ~~(val / 9) + lp = remainder % 5 + pb = ~~(remainder / 5) + dictionarySize = 0 + for (i = 0; i < 4; ++i) { + dictionarySize += (properties[1 + i] & 255) << (i * 8) + } + // NOTE: If the input is bad, it might call for an insanely large dictionary size, which would crash the script. + if (dictionarySize > 99999999 || !$SetLcLpPb(this$static, lc, lp, pb)) { + return 0 + } + return $SetDictionarySize(this$static, dictionarySize) +} + +function $SetDictionarySize(this$static, dictionarySize) { + if (dictionarySize < 0) { + return 0 + } + if (this$static.m_DictionarySize != dictionarySize) { + this$static.m_DictionarySize = dictionarySize + this$static.m_DictionarySizeCheck = Math.max( + this$static.m_DictionarySize, + 1 + ) + $Create_5( + this$static.m_OutWindow, + Math.max(this$static.m_DictionarySizeCheck, 4096) + ) + } + return 1 +} + +function $SetLcLpPb(this$static, lc, lp, pb) { + if (lc > 8 || lp > 4 || pb > 4) { + return 0 + } + $Create_0(this$static.m_LiteralDecoder, lp, lc) + var numPosStates = 1 << pb + $Create(this$static.m_LenDecoder, numPosStates) + $Create(this$static.m_RepLenDecoder, numPosStates) + this$static.m_PosStateMask = numPosStates - 1 + return 1 +} + +function $Create(this$static, numPosStates) { + for ( + ; + this$static.m_NumPosStates < numPosStates; + ++this$static.m_NumPosStates + ) { + this$static.m_LowCoder[this$static.m_NumPosStates] = $BitTreeDecoder({}, 3) + this$static.m_MidCoder[this$static.m_NumPosStates] = $BitTreeDecoder({}, 3) + } +} + +function $Decode(this$static, rangeDecoder, posState) { + if (!$DecodeBit(rangeDecoder, this$static.m_Choice, 0)) { + return $Decode_0(this$static.m_LowCoder[posState], rangeDecoder) + } + var symbol = 8 + if (!$DecodeBit(rangeDecoder, this$static.m_Choice, 1)) { + symbol += $Decode_0(this$static.m_MidCoder[posState], rangeDecoder) + } else { + symbol += 8 + $Decode_0(this$static.m_HighCoder, rangeDecoder) + } + return symbol +} + +function $Decoder$LenDecoder(this$static) { + this$static.m_Choice = initDim(2) + this$static.m_LowCoder = initDim(16) + this$static.m_MidCoder = initDim(16) + this$static.m_HighCoder = $BitTreeDecoder({}, 8) + this$static.m_NumPosStates = 0 + return this$static +} + +function $Init(this$static) { + InitBitModels(this$static.m_Choice) + for (var posState = 0; posState < this$static.m_NumPosStates; ++posState) { + InitBitModels(this$static.m_LowCoder[posState].Models) + InitBitModels(this$static.m_MidCoder[posState].Models) + } + InitBitModels(this$static.m_HighCoder.Models) +} + +function $Create_0(this$static, numPosBits, numPrevBits) { + var i, numStates + if ( + this$static.m_Coders != null && + this$static.m_NumPrevBits == numPrevBits && + this$static.m_NumPosBits == numPosBits + ) + return + this$static.m_NumPosBits = numPosBits + this$static.m_PosMask = (1 << numPosBits) - 1 + this$static.m_NumPrevBits = numPrevBits + numStates = 1 << (this$static.m_NumPrevBits + this$static.m_NumPosBits) + this$static.m_Coders = initDim(numStates) + for (i = 0; i < numStates; ++i) + this$static.m_Coders[i] = $Decoder$LiteralDecoder$Decoder2({}) +} + +function $GetDecoder(this$static, pos, prevByte) { + return this$static.m_Coders[ + ((pos & this$static.m_PosMask) << this$static.m_NumPrevBits) + + ((prevByte & 255) >>> (8 - this$static.m_NumPrevBits)) + ] +} + +function $Init_0(this$static) { + var i, numStates + numStates = 1 << (this$static.m_NumPrevBits + this$static.m_NumPosBits) + for (i = 0; i < numStates; ++i) { + InitBitModels(this$static.m_Coders[i].m_Decoders) + } +} + +function $DecodeNormal(this$static, rangeDecoder) { + var symbol = 1 + do { + symbol = + (symbol << 1) | $DecodeBit(rangeDecoder, this$static.m_Decoders, symbol) + } while (symbol < 256) + return (symbol << 24) >> 24 +} + +function $DecodeWithMatchByte(this$static, rangeDecoder, matchByte) { + var bit, + matchBit, + symbol = 1 + do { + matchBit = (matchByte >> 7) & 1 + matchByte <<= 1 + bit = $DecodeBit( + rangeDecoder, + this$static.m_Decoders, + ((1 + matchBit) << 8) + symbol + ) + symbol = (symbol << 1) | bit + if (matchBit != bit) { + while (symbol < 256) { + symbol = + (symbol << 1) | + $DecodeBit(rangeDecoder, this$static.m_Decoders, symbol) + } + break + } + } while (symbol < 256) + return (symbol << 24) >> 24 +} + +function $Decoder$LiteralDecoder$Decoder2(this$static) { + this$static.m_Decoders = initDim(768) + return this$static +} +var g_FastPos = (function() { + var j, + k, + slotFast, + c = 2, + g_FastPos = [0, 1] + for (slotFast = 2; slotFast < 22; ++slotFast) { + k = 1 << ((slotFast >> 1) - 1) + for (j = 0; j < k; ++j, ++c) g_FastPos[c] = (slotFast << 24) >> 24 + } + return g_FastPos +})() + +function $Backward(this$static, cur) { + var backCur, backMem, posMem, posPrev + this$static._optimumEndIndex = cur + posMem = this$static._optimum[cur].PosPrev + backMem = this$static._optimum[cur].BackPrev + do { + if (this$static._optimum[cur].Prev1IsChar) { + $MakeAsChar(this$static._optimum[posMem]) + this$static._optimum[posMem].PosPrev = posMem - 1 + if (this$static._optimum[cur].Prev2) { + this$static._optimum[posMem - 1].Prev1IsChar = 0 + this$static._optimum[posMem - 1].PosPrev = + this$static._optimum[cur].PosPrev2 + this$static._optimum[posMem - 1].BackPrev = + this$static._optimum[cur].BackPrev2 + } + } + posPrev = posMem + backCur = backMem + backMem = this$static._optimum[posPrev].BackPrev + posMem = this$static._optimum[posPrev].PosPrev + this$static._optimum[posPrev].BackPrev = backCur + this$static._optimum[posPrev].PosPrev = cur + cur = posPrev + } while (cur > 0) + this$static.backRes = this$static._optimum[0].BackPrev + this$static._optimumCurrentIndex = this$static._optimum[0].PosPrev + return this$static._optimumCurrentIndex +} + +function $BaseInit(this$static) { + this$static._state = 0 + this$static._previousByte = 0 + for (var i = 0; i < 4; ++i) { + this$static._repDistances[i] = 0 + } +} + +function $CodeOneBlock(this$static, inSize, outSize, finished) { + var baseVal, + complexState, + curByte, + distance, + footerBits, + i, + len, + lenToPosState, + matchByte, + pos, + posReduced, + posSlot, + posState, + progressPosValuePrev, + subCoder + inSize[0] = P0_longLit + outSize[0] = P0_longLit + finished[0] = 1 + if (this$static._inStream) { + this$static._matchFinder._stream = this$static._inStream + $Init_5(this$static._matchFinder) + this$static._needReleaseMFStream = 1 + this$static._inStream = null + } + if (this$static._finished) { + return + } + this$static._finished = 1 + progressPosValuePrev = this$static.nowPos64 + if (eq(this$static.nowPos64, P0_longLit)) { + if (!$GetNumAvailableBytes(this$static._matchFinder)) { + $Flush(this$static, lowBits_0(this$static.nowPos64)) + return + } + $ReadMatchDistances(this$static) + posState = lowBits_0(this$static.nowPos64) & this$static._posStateMask + $Encode_3( + this$static._rangeEncoder, + this$static._isMatch, + (this$static._state << 4) + posState, + 0 + ) + this$static._state = StateUpdateChar(this$static._state) + curByte = $GetIndexByte( + this$static._matchFinder, + -this$static._additionalOffset + ) + $Encode_1( + $GetSubCoder( + this$static._literalEncoder, + lowBits_0(this$static.nowPos64), + this$static._previousByte + ), + this$static._rangeEncoder, + curByte + ) + this$static._previousByte = curByte + --this$static._additionalOffset + this$static.nowPos64 = add(this$static.nowPos64, P1_longLit) + } + if (!$GetNumAvailableBytes(this$static._matchFinder)) { + $Flush(this$static, lowBits_0(this$static.nowPos64)) + return + } + while (1) { + len = $GetOptimum(this$static, lowBits_0(this$static.nowPos64)) + pos = this$static.backRes + posState = lowBits_0(this$static.nowPos64) & this$static._posStateMask + complexState = (this$static._state << 4) + posState + if (len == 1 && pos == -1) { + $Encode_3( + this$static._rangeEncoder, + this$static._isMatch, + complexState, + 0 + ) + curByte = $GetIndexByte( + this$static._matchFinder, + -this$static._additionalOffset + ) + subCoder = $GetSubCoder( + this$static._literalEncoder, + lowBits_0(this$static.nowPos64), + this$static._previousByte + ) + if (this$static._state < 7) { + $Encode_1(subCoder, this$static._rangeEncoder, curByte) + } else { + matchByte = $GetIndexByte( + this$static._matchFinder, + -this$static._repDistances[0] - 1 - this$static._additionalOffset + ) + $EncodeMatched(subCoder, this$static._rangeEncoder, matchByte, curByte) + } + this$static._previousByte = curByte + this$static._state = StateUpdateChar(this$static._state) + } else { + $Encode_3( + this$static._rangeEncoder, + this$static._isMatch, + complexState, + 1 + ) + if (pos < 4) { + $Encode_3( + this$static._rangeEncoder, + this$static._isRep, + this$static._state, + 1 + ) + if (!pos) { + $Encode_3( + this$static._rangeEncoder, + this$static._isRepG0, + this$static._state, + 0 + ) + if (len == 1) { + $Encode_3( + this$static._rangeEncoder, + this$static._isRep0Long, + complexState, + 0 + ) + } else { + $Encode_3( + this$static._rangeEncoder, + this$static._isRep0Long, + complexState, + 1 + ) + } + } else { + $Encode_3( + this$static._rangeEncoder, + this$static._isRepG0, + this$static._state, + 1 + ) + if (pos == 1) { + $Encode_3( + this$static._rangeEncoder, + this$static._isRepG1, + this$static._state, + 0 + ) + } else { + $Encode_3( + this$static._rangeEncoder, + this$static._isRepG1, + this$static._state, + 1 + ) + $Encode_3( + this$static._rangeEncoder, + this$static._isRepG2, + this$static._state, + pos - 2 + ) + } + } + if (len == 1) { + this$static._state = this$static._state < 7 ? 9 : 11 + } else { + $Encode_0( + this$static._repMatchLenEncoder, + this$static._rangeEncoder, + len - 2, + posState + ) + this$static._state = this$static._state < 7 ? 8 : 11 + } + distance = this$static._repDistances[pos] + if (pos != 0) { + for (i = pos; i >= 1; --i) { + this$static._repDistances[i] = this$static._repDistances[i - 1] + } + this$static._repDistances[0] = distance + } + } else { + $Encode_3( + this$static._rangeEncoder, + this$static._isRep, + this$static._state, + 0 + ) + this$static._state = this$static._state < 7 ? 7 : 10 + $Encode_0( + this$static._lenEncoder, + this$static._rangeEncoder, + len - 2, + posState + ) + pos -= 4 + posSlot = GetPosSlot(pos) + lenToPosState = GetLenToPosState(len) + $Encode_2( + this$static._posSlotEncoder[lenToPosState], + this$static._rangeEncoder, + posSlot + ) + if (posSlot >= 4) { + footerBits = (posSlot >> 1) - 1 + baseVal = (2 | (posSlot & 1)) << footerBits + posReduced = pos - baseVal + if (posSlot < 14) { + ReverseEncode( + this$static._posEncoders, + baseVal - posSlot - 1, + this$static._rangeEncoder, + footerBits, + posReduced + ) + } else { + $EncodeDirectBits( + this$static._rangeEncoder, + posReduced >> 4, + footerBits - 4 + ) + $ReverseEncode( + this$static._posAlignEncoder, + this$static._rangeEncoder, + posReduced & 15 + ) + ++this$static._alignPriceCount + } + } + distance = pos + for (i = 3; i >= 1; --i) { + this$static._repDistances[i] = this$static._repDistances[i - 1] + } + this$static._repDistances[0] = distance + ++this$static._matchPriceCount + } + this$static._previousByte = $GetIndexByte( + this$static._matchFinder, + len - 1 - this$static._additionalOffset + ) + } + this$static._additionalOffset -= len + this$static.nowPos64 = add(this$static.nowPos64, fromInt(len)) + if (!this$static._additionalOffset) { + if (this$static._matchPriceCount >= 128) { + $FillDistancesPrices(this$static) + } + if (this$static._alignPriceCount >= 16) { + $FillAlignPrices(this$static) + } + inSize[0] = this$static.nowPos64 + outSize[0] = $GetProcessedSizeAdd(this$static._rangeEncoder) + if (!$GetNumAvailableBytes(this$static._matchFinder)) { + $Flush(this$static, lowBits_0(this$static.nowPos64)) + return + } + if ( + compare(sub(this$static.nowPos64, progressPosValuePrev), [4096, 0]) >= 0 + ) { + this$static._finished = 0 + finished[0] = 0 + return + } + } + } +} + +function $Create_2(this$static) { + var bt, numHashBytes + if (!this$static._matchFinder) { + bt = {} + numHashBytes = 4 + if (!this$static._matchFinderType) { + numHashBytes = 2 + } + $SetType(bt, numHashBytes) + this$static._matchFinder = bt + } + $Create_1( + this$static._literalEncoder, + this$static._numLiteralPosStateBits, + this$static._numLiteralContextBits + ) + if ( + this$static._dictionarySize == this$static._dictionarySizePrev && + this$static._numFastBytesPrev == this$static._numFastBytes + ) { + return + } + $Create_3( + this$static._matchFinder, + this$static._dictionarySize, + 4096, + this$static._numFastBytes, + 274 + ) + this$static._dictionarySizePrev = this$static._dictionarySize + this$static._numFastBytesPrev = this$static._numFastBytes +} + +function $Encoder(this$static) { + var i + this$static._repDistances = initDim(4) + this$static._optimum = [] + this$static._rangeEncoder = {} + this$static._isMatch = initDim(192) + this$static._isRep = initDim(12) + this$static._isRepG0 = initDim(12) + this$static._isRepG1 = initDim(12) + this$static._isRepG2 = initDim(12) + this$static._isRep0Long = initDim(192) + this$static._posSlotEncoder = [] + this$static._posEncoders = initDim(114) + this$static._posAlignEncoder = $BitTreeEncoder({}, 4) + this$static._lenEncoder = $Encoder$LenPriceTableEncoder({}) + this$static._repMatchLenEncoder = $Encoder$LenPriceTableEncoder({}) + this$static._literalEncoder = {} + this$static._matchDistances = [] + this$static._posSlotPrices = [] + this$static._distancesPrices = [] + this$static._alignPrices = initDim(16) + this$static.reps = initDim(4) + this$static.repLens = initDim(4) + this$static.processedInSize = [P0_longLit] + this$static.processedOutSize = [P0_longLit] + this$static.finished = [0] + this$static.properties = initDim(5) + this$static.tempPrices = initDim(128) + this$static._longestMatchLength = 0 + this$static._matchFinderType = 1 + this$static._numDistancePairs = 0 + this$static._numFastBytesPrev = -1 + this$static.backRes = 0 + for (i = 0; i < 4096; ++i) { + this$static._optimum[i] = {} + } + for (i = 0; i < 4; ++i) { + this$static._posSlotEncoder[i] = $BitTreeEncoder({}, 6) + } + return this$static +} + +function $FillAlignPrices(this$static) { + for (var i = 0; i < 16; ++i) { + this$static._alignPrices[i] = $ReverseGetPrice( + this$static._posAlignEncoder, + i + ) + } + this$static._alignPriceCount = 0 +} + +function $FillDistancesPrices(this$static) { + var baseVal, encoder, footerBits, i, lenToPosState, posSlot, st, st2 + for (i = 4; i < 128; ++i) { + posSlot = GetPosSlot(i) + footerBits = (posSlot >> 1) - 1 + baseVal = (2 | (posSlot & 1)) << footerBits + this$static.tempPrices[i] = ReverseGetPrice( + this$static._posEncoders, + baseVal - posSlot - 1, + footerBits, + i - baseVal + ) + } + for (lenToPosState = 0; lenToPosState < 4; ++lenToPosState) { + encoder = this$static._posSlotEncoder[lenToPosState] + st = lenToPosState << 6 + for (posSlot = 0; posSlot < this$static._distTableSize; ++posSlot) { + this$static._posSlotPrices[st + posSlot] = $GetPrice_1(encoder, posSlot) + } + for (posSlot = 14; posSlot < this$static._distTableSize; ++posSlot) { + this$static._posSlotPrices[st + posSlot] += ((posSlot >> 1) - 1 - 4) << 6 + } + st2 = lenToPosState * 128 + for (i = 0; i < 4; ++i) { + this$static._distancesPrices[st2 + i] = this$static._posSlotPrices[st + i] + } + for (; i < 128; ++i) { + this$static._distancesPrices[st2 + i] = + this$static._posSlotPrices[st + GetPosSlot(i)] + + this$static.tempPrices[i] + } + } + this$static._matchPriceCount = 0 +} + +function $Flush(this$static, nowPos) { + $ReleaseMFStream(this$static) + $WriteEndMarker(this$static, nowPos & this$static._posStateMask) + for (var i = 0; i < 5; ++i) { + $ShiftLow(this$static._rangeEncoder) + } +} + +function $GetOptimum(this$static, position) { + var cur, + curAnd1Price, + curAndLenCharPrice, + curAndLenPrice, + curBack, + curPrice, + currentByte, + distance, + i, + len, + lenEnd, + lenMain, + lenRes, + lenTest, + lenTest2, + lenTestTemp, + matchByte, + matchPrice, + newLen, + nextIsChar, + nextMatchPrice, + nextOptimum, + nextRepMatchPrice, + normalMatchPrice, + numAvailableBytes, + numAvailableBytesFull, + numDistancePairs, + offs, + offset, + opt, + optimum, + pos, + posPrev, + posState, + posStateNext, + price_4, + repIndex, + repLen, + repMatchPrice, + repMaxIndex, + shortRepPrice, + startLen, + state, + state2, + t, + price, + price_0, + price_1, + price_2, + price_3 + if (this$static._optimumEndIndex != this$static._optimumCurrentIndex) { + lenRes = + this$static._optimum[this$static._optimumCurrentIndex].PosPrev - + this$static._optimumCurrentIndex + this$static.backRes = + this$static._optimum[this$static._optimumCurrentIndex].BackPrev + this$static._optimumCurrentIndex = + this$static._optimum[this$static._optimumCurrentIndex].PosPrev + return lenRes + } + this$static._optimumCurrentIndex = this$static._optimumEndIndex = 0 + if (this$static._longestMatchWasFound) { + lenMain = this$static._longestMatchLength + this$static._longestMatchWasFound = 0 + } else { + lenMain = $ReadMatchDistances(this$static) + } + numDistancePairs = this$static._numDistancePairs + numAvailableBytes = $GetNumAvailableBytes(this$static._matchFinder) + 1 + if (numAvailableBytes < 2) { + this$static.backRes = -1 + return 1 + } + if (numAvailableBytes > 273) { + numAvailableBytes = 273 + } + repMaxIndex = 0 + for (i = 0; i < 4; ++i) { + this$static.reps[i] = this$static._repDistances[i] + this$static.repLens[i] = $GetMatchLen( + this$static._matchFinder, + -1, + this$static.reps[i], + 273 + ) + if (this$static.repLens[i] > this$static.repLens[repMaxIndex]) { + repMaxIndex = i + } + } + if (this$static.repLens[repMaxIndex] >= this$static._numFastBytes) { + this$static.backRes = repMaxIndex + lenRes = this$static.repLens[repMaxIndex] + $MovePos(this$static, lenRes - 1) + return lenRes + } + if (lenMain >= this$static._numFastBytes) { + this$static.backRes = this$static._matchDistances[numDistancePairs - 1] + 4 + $MovePos(this$static, lenMain - 1) + return lenMain + } + currentByte = $GetIndexByte(this$static._matchFinder, -1) + matchByte = $GetIndexByte( + this$static._matchFinder, + -this$static._repDistances[0] - 1 - 1 + ) + if ( + lenMain < 2 && + currentByte != matchByte && + this$static.repLens[repMaxIndex] < 2 + ) { + this$static.backRes = -1 + return 1 + } + this$static._optimum[0].State = this$static._state + posState = position & this$static._posStateMask + this$static._optimum[1].Price = + ProbPrices[ + this$static._isMatch[(this$static._state << 4) + posState] >>> 2 + ] + + $GetPrice_0( + $GetSubCoder( + this$static._literalEncoder, + position, + this$static._previousByte + ), + this$static._state >= 7, + matchByte, + currentByte + ) + $MakeAsChar(this$static._optimum[1]) + matchPrice = + ProbPrices[ + (2048 - this$static._isMatch[(this$static._state << 4) + posState]) >>> 2 + ] + repMatchPrice = + matchPrice + + ProbPrices[(2048 - this$static._isRep[this$static._state]) >>> 2] + if (matchByte == currentByte) { + shortRepPrice = + repMatchPrice + + $GetRepLen1Price(this$static, this$static._state, posState) + if (shortRepPrice < this$static._optimum[1].Price) { + this$static._optimum[1].Price = shortRepPrice + $MakeAsShortRep(this$static._optimum[1]) + } + } + lenEnd = + lenMain >= this$static.repLens[repMaxIndex] + ? lenMain + : this$static.repLens[repMaxIndex] + if (lenEnd < 2) { + this$static.backRes = this$static._optimum[1].BackPrev + return 1 + } + this$static._optimum[1].PosPrev = 0 + this$static._optimum[0].Backs0 = this$static.reps[0] + this$static._optimum[0].Backs1 = this$static.reps[1] + this$static._optimum[0].Backs2 = this$static.reps[2] + this$static._optimum[0].Backs3 = this$static.reps[3] + len = lenEnd + do { + this$static._optimum[len--].Price = 268435455 + } while (len >= 2) + for (i = 0; i < 4; ++i) { + repLen = this$static.repLens[i] + if (repLen < 2) { + continue + } + price_4 = + repMatchPrice + + $GetPureRepPrice(this$static, i, this$static._state, posState) + do { + curAndLenPrice = + price_4 + + $GetPrice(this$static._repMatchLenEncoder, repLen - 2, posState) + optimum = this$static._optimum[repLen] + if (curAndLenPrice < optimum.Price) { + optimum.Price = curAndLenPrice + optimum.PosPrev = 0 + optimum.BackPrev = i + optimum.Prev1IsChar = 0 + } + } while (--repLen >= 2) + } + normalMatchPrice = + matchPrice + ProbPrices[this$static._isRep[this$static._state] >>> 2] + len = this$static.repLens[0] >= 2 ? this$static.repLens[0] + 1 : 2 + if (len <= lenMain) { + offs = 0 + while (len > this$static._matchDistances[offs]) { + offs += 2 + } + for (; ; ++len) { + distance = this$static._matchDistances[offs + 1] + curAndLenPrice = + normalMatchPrice + $GetPosLenPrice(this$static, distance, len, posState) + optimum = this$static._optimum[len] + if (curAndLenPrice < optimum.Price) { + optimum.Price = curAndLenPrice + optimum.PosPrev = 0 + optimum.BackPrev = distance + 4 + optimum.Prev1IsChar = 0 + } + if (len == this$static._matchDistances[offs]) { + offs += 2 + if (offs == numDistancePairs) { + break + } + } + } + } + cur = 0 + while (1) { + ++cur + if (cur == lenEnd) { + return $Backward(this$static, cur) + } + newLen = $ReadMatchDistances(this$static) + numDistancePairs = this$static._numDistancePairs + if (newLen >= this$static._numFastBytes) { + this$static._longestMatchLength = newLen + this$static._longestMatchWasFound = 1 + return $Backward(this$static, cur) + } + ++position + posPrev = this$static._optimum[cur].PosPrev + if (this$static._optimum[cur].Prev1IsChar) { + --posPrev + if (this$static._optimum[cur].Prev2) { + state = this$static._optimum[this$static._optimum[cur].PosPrev2].State + if (this$static._optimum[cur].BackPrev2 < 4) { + state = state < 7 ? 8 : 11 + } else { + state = state < 7 ? 7 : 10 + } + } else { + state = this$static._optimum[posPrev].State + } + state = StateUpdateChar(state) + } else { + state = this$static._optimum[posPrev].State + } + if (posPrev == cur - 1) { + if (!this$static._optimum[cur].BackPrev) { + state = state < 7 ? 9 : 11 + } else { + state = StateUpdateChar(state) + } + } else { + if ( + this$static._optimum[cur].Prev1IsChar && + this$static._optimum[cur].Prev2 + ) { + posPrev = this$static._optimum[cur].PosPrev2 + pos = this$static._optimum[cur].BackPrev2 + state = state < 7 ? 8 : 11 + } else { + pos = this$static._optimum[cur].BackPrev + if (pos < 4) { + state = state < 7 ? 8 : 11 + } else { + state = state < 7 ? 7 : 10 + } + } + opt = this$static._optimum[posPrev] + if (pos < 4) { + if (!pos) { + this$static.reps[0] = opt.Backs0 + this$static.reps[1] = opt.Backs1 + this$static.reps[2] = opt.Backs2 + this$static.reps[3] = opt.Backs3 + } else if (pos == 1) { + this$static.reps[0] = opt.Backs1 + this$static.reps[1] = opt.Backs0 + this$static.reps[2] = opt.Backs2 + this$static.reps[3] = opt.Backs3 + } else if (pos == 2) { + this$static.reps[0] = opt.Backs2 + this$static.reps[1] = opt.Backs0 + this$static.reps[2] = opt.Backs1 + this$static.reps[3] = opt.Backs3 + } else { + this$static.reps[0] = opt.Backs3 + this$static.reps[1] = opt.Backs0 + this$static.reps[2] = opt.Backs1 + this$static.reps[3] = opt.Backs2 + } + } else { + this$static.reps[0] = pos - 4 + this$static.reps[1] = opt.Backs0 + this$static.reps[2] = opt.Backs1 + this$static.reps[3] = opt.Backs2 + } + } + this$static._optimum[cur].State = state + this$static._optimum[cur].Backs0 = this$static.reps[0] + this$static._optimum[cur].Backs1 = this$static.reps[1] + this$static._optimum[cur].Backs2 = this$static.reps[2] + this$static._optimum[cur].Backs3 = this$static.reps[3] + curPrice = this$static._optimum[cur].Price + currentByte = $GetIndexByte(this$static._matchFinder, -1) + matchByte = $GetIndexByte( + this$static._matchFinder, + -this$static.reps[0] - 1 - 1 + ) + posState = position & this$static._posStateMask + curAnd1Price = + curPrice + + ProbPrices[this$static._isMatch[(state << 4) + posState] >>> 2] + + $GetPrice_0( + $GetSubCoder( + this$static._literalEncoder, + position, + $GetIndexByte(this$static._matchFinder, -2) + ), + state >= 7, + matchByte, + currentByte + ) + nextOptimum = this$static._optimum[cur + 1] + nextIsChar = 0 + if (curAnd1Price < nextOptimum.Price) { + nextOptimum.Price = curAnd1Price + nextOptimum.PosPrev = cur + nextOptimum.BackPrev = -1 + nextOptimum.Prev1IsChar = 0 + nextIsChar = 1 + } + matchPrice = + curPrice + + ProbPrices[(2048 - this$static._isMatch[(state << 4) + posState]) >>> 2] + repMatchPrice = + matchPrice + ProbPrices[(2048 - this$static._isRep[state]) >>> 2] + if ( + matchByte == currentByte && + !(nextOptimum.PosPrev < cur && !nextOptimum.BackPrev) + ) { + shortRepPrice = + repMatchPrice + + (ProbPrices[this$static._isRepG0[state] >>> 2] + + ProbPrices[this$static._isRep0Long[(state << 4) + posState] >>> 2]) + if (shortRepPrice <= nextOptimum.Price) { + nextOptimum.Price = shortRepPrice + nextOptimum.PosPrev = cur + nextOptimum.BackPrev = 0 + nextOptimum.Prev1IsChar = 0 + nextIsChar = 1 + } + } + numAvailableBytesFull = $GetNumAvailableBytes(this$static._matchFinder) + 1 + numAvailableBytesFull = + 4095 - cur < numAvailableBytesFull ? 4095 - cur : numAvailableBytesFull + numAvailableBytes = numAvailableBytesFull + if (numAvailableBytes < 2) { + continue + } + if (numAvailableBytes > this$static._numFastBytes) { + numAvailableBytes = this$static._numFastBytes + } + if (!nextIsChar && matchByte != currentByte) { + t = Math.min(numAvailableBytesFull - 1, this$static._numFastBytes) + lenTest2 = $GetMatchLen( + this$static._matchFinder, + 0, + this$static.reps[0], + t + ) + if (lenTest2 >= 2) { + state2 = StateUpdateChar(state) + posStateNext = (position + 1) & this$static._posStateMask + nextRepMatchPrice = + curAnd1Price + + ProbPrices[ + (2048 - this$static._isMatch[(state2 << 4) + posStateNext]) >>> 2 + ] + + ProbPrices[(2048 - this$static._isRep[state2]) >>> 2] + offset = cur + 1 + lenTest2 + while (lenEnd < offset) { + this$static._optimum[++lenEnd].Price = 268435455 + } + curAndLenPrice = + nextRepMatchPrice + + ((price = $GetPrice( + this$static._repMatchLenEncoder, + lenTest2 - 2, + posStateNext + )), + price + $GetPureRepPrice(this$static, 0, state2, posStateNext)) + optimum = this$static._optimum[offset] + if (curAndLenPrice < optimum.Price) { + optimum.Price = curAndLenPrice + optimum.PosPrev = cur + 1 + optimum.BackPrev = 0 + optimum.Prev1IsChar = 1 + optimum.Prev2 = 0 + } + } + } + startLen = 2 + for (repIndex = 0; repIndex < 4; ++repIndex) { + lenTest = $GetMatchLen( + this$static._matchFinder, + -1, + this$static.reps[repIndex], + numAvailableBytes + ) + if (lenTest < 2) { + continue + } + lenTestTemp = lenTest + do { + while (lenEnd < cur + lenTest) { + this$static._optimum[++lenEnd].Price = 268435455 + } + curAndLenPrice = + repMatchPrice + + ((price_0 = $GetPrice( + this$static._repMatchLenEncoder, + lenTest - 2, + posState + )), + price_0 + $GetPureRepPrice(this$static, repIndex, state, posState)) + optimum = this$static._optimum[cur + lenTest] + if (curAndLenPrice < optimum.Price) { + optimum.Price = curAndLenPrice + optimum.PosPrev = cur + optimum.BackPrev = repIndex + optimum.Prev1IsChar = 0 + } + } while (--lenTest >= 2) + lenTest = lenTestTemp + if (!repIndex) { + startLen = lenTest + 1 + } + if (lenTest < numAvailableBytesFull) { + t = Math.min( + numAvailableBytesFull - 1 - lenTest, + this$static._numFastBytes + ) + lenTest2 = $GetMatchLen( + this$static._matchFinder, + lenTest, + this$static.reps[repIndex], + t + ) + if (lenTest2 >= 2) { + state2 = state < 7 ? 8 : 11 + posStateNext = (position + lenTest) & this$static._posStateMask + curAndLenCharPrice = + repMatchPrice + + ((price_1 = $GetPrice( + this$static._repMatchLenEncoder, + lenTest - 2, + posState + )), + price_1 + + $GetPureRepPrice(this$static, repIndex, state, posState)) + + ProbPrices[ + this$static._isMatch[(state2 << 4) + posStateNext] >>> 2 + ] + + $GetPrice_0( + $GetSubCoder( + this$static._literalEncoder, + position + lenTest, + $GetIndexByte(this$static._matchFinder, lenTest - 1 - 1) + ), + 1, + $GetIndexByte( + this$static._matchFinder, + lenTest - 1 - (this$static.reps[repIndex] + 1) + ), + $GetIndexByte(this$static._matchFinder, lenTest - 1) + ) + state2 = StateUpdateChar(state2) + posStateNext = (position + lenTest + 1) & this$static._posStateMask + nextMatchPrice = + curAndLenCharPrice + + ProbPrices[ + (2048 - this$static._isMatch[(state2 << 4) + posStateNext]) >>> 2 + ] + nextRepMatchPrice = + nextMatchPrice + + ProbPrices[(2048 - this$static._isRep[state2]) >>> 2] + offset = lenTest + 1 + lenTest2 + while (lenEnd < cur + offset) { + this$static._optimum[++lenEnd].Price = 268435455 + } + curAndLenPrice = + nextRepMatchPrice + + ((price_2 = $GetPrice( + this$static._repMatchLenEncoder, + lenTest2 - 2, + posStateNext + )), + price_2 + $GetPureRepPrice(this$static, 0, state2, posStateNext)) + optimum = this$static._optimum[cur + offset] + if (curAndLenPrice < optimum.Price) { + optimum.Price = curAndLenPrice + optimum.PosPrev = cur + lenTest + 1 + optimum.BackPrev = 0 + optimum.Prev1IsChar = 1 + optimum.Prev2 = 1 + optimum.PosPrev2 = cur + optimum.BackPrev2 = repIndex + } + } + } + } + if (newLen > numAvailableBytes) { + newLen = numAvailableBytes + for ( + numDistancePairs = 0; + newLen > this$static._matchDistances[numDistancePairs]; + numDistancePairs += 2 + ) {} + this$static._matchDistances[numDistancePairs] = newLen + numDistancePairs += 2 + } + if (newLen >= startLen) { + normalMatchPrice = + matchPrice + ProbPrices[this$static._isRep[state] >>> 2] + while (lenEnd < cur + newLen) { + this$static._optimum[++lenEnd].Price = 268435455 + } + offs = 0 + while (startLen > this$static._matchDistances[offs]) { + offs += 2 + } + for (lenTest = startLen; ; ++lenTest) { + curBack = this$static._matchDistances[offs + 1] + curAndLenPrice = + normalMatchPrice + + $GetPosLenPrice(this$static, curBack, lenTest, posState) + optimum = this$static._optimum[cur + lenTest] + if (curAndLenPrice < optimum.Price) { + optimum.Price = curAndLenPrice + optimum.PosPrev = cur + optimum.BackPrev = curBack + 4 + optimum.Prev1IsChar = 0 + } + if (lenTest == this$static._matchDistances[offs]) { + if (lenTest < numAvailableBytesFull) { + t = Math.min( + numAvailableBytesFull - 1 - lenTest, + this$static._numFastBytes + ) + lenTest2 = $GetMatchLen( + this$static._matchFinder, + lenTest, + curBack, + t + ) + if (lenTest2 >= 2) { + state2 = state < 7 ? 7 : 10 + posStateNext = (position + lenTest) & this$static._posStateMask + curAndLenCharPrice = + curAndLenPrice + + ProbPrices[ + this$static._isMatch[(state2 << 4) + posStateNext] >>> 2 + ] + + $GetPrice_0( + $GetSubCoder( + this$static._literalEncoder, + position + lenTest, + $GetIndexByte(this$static._matchFinder, lenTest - 1 - 1) + ), + 1, + $GetIndexByte( + this$static._matchFinder, + lenTest - (curBack + 1) - 1 + ), + $GetIndexByte(this$static._matchFinder, lenTest - 1) + ) + state2 = StateUpdateChar(state2) + posStateNext = + (position + lenTest + 1) & this$static._posStateMask + nextMatchPrice = + curAndLenCharPrice + + ProbPrices[ + (2048 - + this$static._isMatch[(state2 << 4) + posStateNext]) >>> + 2 + ] + nextRepMatchPrice = + nextMatchPrice + + ProbPrices[(2048 - this$static._isRep[state2]) >>> 2] + offset = lenTest + 1 + lenTest2 + while (lenEnd < cur + offset) { + this$static._optimum[++lenEnd].Price = 268435455 + } + curAndLenPrice = + nextRepMatchPrice + + ((price_3 = $GetPrice( + this$static._repMatchLenEncoder, + lenTest2 - 2, + posStateNext + )), + price_3 + + $GetPureRepPrice(this$static, 0, state2, posStateNext)) + optimum = this$static._optimum[cur + offset] + if (curAndLenPrice < optimum.Price) { + optimum.Price = curAndLenPrice + optimum.PosPrev = cur + lenTest + 1 + optimum.BackPrev = 0 + optimum.Prev1IsChar = 1 + optimum.Prev2 = 1 + optimum.PosPrev2 = cur + optimum.BackPrev2 = curBack + 4 + } + } + } + offs += 2 + if (offs == numDistancePairs) break + } + } + } + } +} + +function $GetPosLenPrice(this$static, pos, len, posState) { + var price, + lenToPosState = GetLenToPosState(len) + if (pos < 128) { + price = this$static._distancesPrices[lenToPosState * 128 + pos] + } else { + price = + this$static._posSlotPrices[(lenToPosState << 6) + GetPosSlot2(pos)] + + this$static._alignPrices[pos & 15] + } + return price + $GetPrice(this$static._lenEncoder, len - 2, posState) +} + +function $GetPureRepPrice(this$static, repIndex, state, posState) { + var price + if (!repIndex) { + price = ProbPrices[this$static._isRepG0[state] >>> 2] + price += + ProbPrices[ + (2048 - this$static._isRep0Long[(state << 4) + posState]) >>> 2 + ] + } else { + price = ProbPrices[(2048 - this$static._isRepG0[state]) >>> 2] + if (repIndex == 1) { + price += ProbPrices[this$static._isRepG1[state] >>> 2] + } else { + price += ProbPrices[(2048 - this$static._isRepG1[state]) >>> 2] + price += GetPrice(this$static._isRepG2[state], repIndex - 2) + } + } + return price +} + +function $GetRepLen1Price(this$static, state, posState) { + return ( + ProbPrices[this$static._isRepG0[state] >>> 2] + + ProbPrices[this$static._isRep0Long[(state << 4) + posState] >>> 2] + ) +} + +function $Init_4(this$static) { + $BaseInit(this$static) + $Init_9(this$static._rangeEncoder) + InitBitModels(this$static._isMatch) + InitBitModels(this$static._isRep0Long) + InitBitModels(this$static._isRep) + InitBitModels(this$static._isRepG0) + InitBitModels(this$static._isRepG1) + InitBitModels(this$static._isRepG2) + InitBitModels(this$static._posEncoders) + $Init_3(this$static._literalEncoder) + for (var i = 0; i < 4; ++i) { + InitBitModels(this$static._posSlotEncoder[i].Models) + } + $Init_2(this$static._lenEncoder, 1 << this$static._posStateBits) + $Init_2(this$static._repMatchLenEncoder, 1 << this$static._posStateBits) + InitBitModels(this$static._posAlignEncoder.Models) + this$static._longestMatchWasFound = 0 + this$static._optimumEndIndex = 0 + this$static._optimumCurrentIndex = 0 + this$static._additionalOffset = 0 +} + +function $MovePos(this$static, num) { + if (num > 0) { + $Skip(this$static._matchFinder, num) + this$static._additionalOffset += num + } +} + +function $ReadMatchDistances(this$static) { + var lenRes = 0 + this$static._numDistancePairs = $GetMatches( + this$static._matchFinder, + this$static._matchDistances + ) + if (this$static._numDistancePairs > 0) { + lenRes = this$static._matchDistances[this$static._numDistancePairs - 2] + if (lenRes == this$static._numFastBytes) + lenRes += $GetMatchLen( + this$static._matchFinder, + lenRes - 1, + this$static._matchDistances[this$static._numDistancePairs - 1], + 273 - lenRes + ) + } + ++this$static._additionalOffset + return lenRes +} + +function $ReleaseMFStream(this$static) { + if (this$static._matchFinder && this$static._needReleaseMFStream) { + this$static._matchFinder._stream = null + this$static._needReleaseMFStream = 0 + } +} + +function $ReleaseStreams(this$static) { + $ReleaseMFStream(this$static) + this$static._rangeEncoder.Stream = null +} + +function $SetDictionarySize_0(this$static, dictionarySize) { + this$static._dictionarySize = dictionarySize + for (var dicLogSize = 0; dictionarySize > 1 << dicLogSize; ++dicLogSize) {} + this$static._distTableSize = dicLogSize * 2 +} + +function $SetMatchFinder(this$static, matchFinderIndex) { + var matchFinderIndexPrev = this$static._matchFinderType + this$static._matchFinderType = matchFinderIndex + if ( + this$static._matchFinder && + matchFinderIndexPrev != this$static._matchFinderType + ) { + this$static._dictionarySizePrev = -1 + this$static._matchFinder = null + } +} + +function $WriteCoderProperties(this$static, outStream) { + this$static.properties[0] = + (((this$static._posStateBits * 5 + this$static._numLiteralPosStateBits) * + 9 + + this$static._numLiteralContextBits) << + 24) >> + 24 + for (var i = 0; i < 4; ++i) { + this$static.properties[1 + i] = + ((this$static._dictionarySize >> (8 * i)) << 24) >> 24 + } + $write_0(outStream, this$static.properties, 0, 5) +} + +function $WriteEndMarker(this$static, posState) { + if (!this$static._writeEndMark) { + return + } + $Encode_3( + this$static._rangeEncoder, + this$static._isMatch, + (this$static._state << 4) + posState, + 1 + ) + $Encode_3( + this$static._rangeEncoder, + this$static._isRep, + this$static._state, + 0 + ) + this$static._state = this$static._state < 7 ? 7 : 10 + $Encode_0(this$static._lenEncoder, this$static._rangeEncoder, 0, posState) + var lenToPosState = GetLenToPosState(2) + $Encode_2( + this$static._posSlotEncoder[lenToPosState], + this$static._rangeEncoder, + 63 + ) + $EncodeDirectBits(this$static._rangeEncoder, 67108863, 26) + $ReverseEncode(this$static._posAlignEncoder, this$static._rangeEncoder, 15) +} + +function GetPosSlot(pos) { + if (pos < 2048) { + return g_FastPos[pos] + } + if (pos < 2097152) { + return g_FastPos[pos >> 10] + 20 + } + return g_FastPos[pos >> 20] + 40 +} + +function GetPosSlot2(pos) { + if (pos < 131072) { + return g_FastPos[pos >> 6] + 12 + } + if (pos < 134217728) { + return g_FastPos[pos >> 16] + 32 + } + return g_FastPos[pos >> 26] + 52 +} + +function $Encode(this$static, rangeEncoder, symbol, posState) { + if (symbol < 8) { + $Encode_3(rangeEncoder, this$static._choice, 0, 0) + $Encode_2(this$static._lowCoder[posState], rangeEncoder, symbol) + } else { + symbol -= 8 + $Encode_3(rangeEncoder, this$static._choice, 0, 1) + if (symbol < 8) { + $Encode_3(rangeEncoder, this$static._choice, 1, 0) + $Encode_2(this$static._midCoder[posState], rangeEncoder, symbol) + } else { + $Encode_3(rangeEncoder, this$static._choice, 1, 1) + $Encode_2(this$static._highCoder, rangeEncoder, symbol - 8) + } + } +} + +function $Encoder$LenEncoder(this$static) { + this$static._choice = initDim(2) + this$static._lowCoder = initDim(16) + this$static._midCoder = initDim(16) + this$static._highCoder = $BitTreeEncoder({}, 8) + for (var posState = 0; posState < 16; ++posState) { + this$static._lowCoder[posState] = $BitTreeEncoder({}, 3) + this$static._midCoder[posState] = $BitTreeEncoder({}, 3) + } + return this$static +} + +function $Init_2(this$static, numPosStates) { + InitBitModels(this$static._choice) + for (var posState = 0; posState < numPosStates; ++posState) { + InitBitModels(this$static._lowCoder[posState].Models) + InitBitModels(this$static._midCoder[posState].Models) + } + InitBitModels(this$static._highCoder.Models) +} + +function $SetPrices(this$static, posState, numSymbols, prices, st) { + var a0, a1, b0, b1, i + a0 = ProbPrices[this$static._choice[0] >>> 2] + a1 = ProbPrices[(2048 - this$static._choice[0]) >>> 2] + b0 = a1 + ProbPrices[this$static._choice[1] >>> 2] + b1 = a1 + ProbPrices[(2048 - this$static._choice[1]) >>> 2] + i = 0 + for (i = 0; i < 8; ++i) { + if (i >= numSymbols) return + prices[st + i] = a0 + $GetPrice_1(this$static._lowCoder[posState], i) + } + for (; i < 16; ++i) { + if (i >= numSymbols) return + prices[st + i] = b0 + $GetPrice_1(this$static._midCoder[posState], i - 8) + } + for (; i < numSymbols; ++i) { + prices[st + i] = b1 + $GetPrice_1(this$static._highCoder, i - 8 - 8) + } +} + +function $Encode_0(this$static, rangeEncoder, symbol, posState) { + $Encode(this$static, rangeEncoder, symbol, posState) + if (--this$static._counters[posState] == 0) { + $SetPrices( + this$static, + posState, + this$static._tableSize, + this$static._prices, + posState * 272 + ) + this$static._counters[posState] = this$static._tableSize + } +} + +function $Encoder$LenPriceTableEncoder(this$static) { + $Encoder$LenEncoder(this$static) + this$static._prices = [] + this$static._counters = [] + return this$static +} + +function $GetPrice(this$static, symbol, posState) { + return this$static._prices[posState * 272 + symbol] +} + +function $UpdateTables(this$static, numPosStates) { + for (var posState = 0; posState < numPosStates; ++posState) { + $SetPrices( + this$static, + posState, + this$static._tableSize, + this$static._prices, + posState * 272 + ) + this$static._counters[posState] = this$static._tableSize + } +} + +function $Create_1(this$static, numPosBits, numPrevBits) { + var i, numStates + if ( + this$static.m_Coders != null && + this$static.m_NumPrevBits == numPrevBits && + this$static.m_NumPosBits == numPosBits + ) { + return + } + this$static.m_NumPosBits = numPosBits + this$static.m_PosMask = (1 << numPosBits) - 1 + this$static.m_NumPrevBits = numPrevBits + numStates = 1 << (this$static.m_NumPrevBits + this$static.m_NumPosBits) + this$static.m_Coders = initDim(numStates) + for (i = 0; i < numStates; ++i) { + this$static.m_Coders[i] = $Encoder$LiteralEncoder$Encoder2({}) + } +} + +function $GetSubCoder(this$static, pos, prevByte) { + return this$static.m_Coders[ + ((pos & this$static.m_PosMask) << this$static.m_NumPrevBits) + + ((prevByte & 255) >>> (8 - this$static.m_NumPrevBits)) + ] +} + +function $Init_3(this$static) { + var i, + numStates = 1 << (this$static.m_NumPrevBits + this$static.m_NumPosBits) + for (i = 0; i < numStates; ++i) { + InitBitModels(this$static.m_Coders[i].m_Encoders) + } +} + +function $Encode_1(this$static, rangeEncoder, symbol) { + var bit, + i, + context = 1 + for (i = 7; i >= 0; --i) { + bit = (symbol >> i) & 1 + $Encode_3(rangeEncoder, this$static.m_Encoders, context, bit) + context = (context << 1) | bit + } +} + +function $EncodeMatched(this$static, rangeEncoder, matchByte, symbol) { + var bit, + i, + matchBit, + state, + same = 1, + context = 1 + for (i = 7; i >= 0; --i) { + bit = (symbol >> i) & 1 + state = context + if (same) { + matchBit = (matchByte >> i) & 1 + state += (1 + matchBit) << 8 + same = matchBit == bit + } + $Encode_3(rangeEncoder, this$static.m_Encoders, state, bit) + context = (context << 1) | bit + } +} + +function $Encoder$LiteralEncoder$Encoder2(this$static) { + this$static.m_Encoders = initDim(768) + return this$static +} + +function $GetPrice_0(this$static, matchMode, matchByte, symbol) { + var bit, + context = 1, + i = 7, + matchBit, + price = 0 + if (matchMode) { + for (; i >= 0; --i) { + matchBit = (matchByte >> i) & 1 + bit = (symbol >> i) & 1 + price += GetPrice( + this$static.m_Encoders[((1 + matchBit) << 8) + context], + bit + ) + context = (context << 1) | bit + if (matchBit != bit) { + --i + break + } + } + } + for (; i >= 0; --i) { + bit = (symbol >> i) & 1 + price += GetPrice(this$static.m_Encoders[context], bit) + context = (context << 1) | bit + } + return price +} + +function $MakeAsChar(this$static) { + this$static.BackPrev = -1 + this$static.Prev1IsChar = 0 +} + +function $MakeAsShortRep(this$static) { + this$static.BackPrev = 0 + this$static.Prev1IsChar = 0 +} +function $BitTreeDecoder(this$static, numBitLevels) { + this$static.NumBitLevels = numBitLevels + this$static.Models = initDim(1 << numBitLevels) + return this$static +} + +function $Decode_0(this$static, rangeDecoder) { + var bitIndex, + m = 1 + for (bitIndex = this$static.NumBitLevels; bitIndex != 0; --bitIndex) { + m = (m << 1) + $DecodeBit(rangeDecoder, this$static.Models, m) + } + return m - (1 << this$static.NumBitLevels) +} + +function $ReverseDecode(this$static, rangeDecoder) { + var bit, + bitIndex, + m = 1, + symbol = 0 + for (bitIndex = 0; bitIndex < this$static.NumBitLevels; ++bitIndex) { + bit = $DecodeBit(rangeDecoder, this$static.Models, m) + m <<= 1 + m += bit + symbol |= bit << bitIndex + } + return symbol +} + +function ReverseDecode(Models, startIndex, rangeDecoder, NumBitLevels) { + var bit, + bitIndex, + m = 1, + symbol = 0 + for (bitIndex = 0; bitIndex < NumBitLevels; ++bitIndex) { + bit = $DecodeBit(rangeDecoder, Models, startIndex + m) + m <<= 1 + m += bit + symbol |= bit << bitIndex + } + return symbol +} +function $BitTreeEncoder(this$static, numBitLevels) { + this$static.NumBitLevels = numBitLevels + this$static.Models = initDim(1 << numBitLevels) + return this$static +} + +function $Encode_2(this$static, rangeEncoder, symbol) { + var bit, + bitIndex, + m = 1 + for (bitIndex = this$static.NumBitLevels; bitIndex != 0; ) { + --bitIndex + bit = (symbol >>> bitIndex) & 1 + $Encode_3(rangeEncoder, this$static.Models, m, bit) + m = (m << 1) | bit + } +} + +function $GetPrice_1(this$static, symbol) { + var bit, + bitIndex, + m = 1, + price = 0 + for (bitIndex = this$static.NumBitLevels; bitIndex != 0; ) { + --bitIndex + bit = (symbol >>> bitIndex) & 1 + price += GetPrice(this$static.Models[m], bit) + m = (m << 1) + bit + } + return price +} + +function $ReverseEncode(this$static, rangeEncoder, symbol) { + var bit, + i, + m = 1 + for (i = 0; i < this$static.NumBitLevels; ++i) { + bit = symbol & 1 + $Encode_3(rangeEncoder, this$static.Models, m, bit) + m = (m << 1) | bit + symbol >>= 1 + } +} + +function $ReverseGetPrice(this$static, symbol) { + var bit, + i, + m = 1, + price = 0 + for (i = this$static.NumBitLevels; i != 0; --i) { + bit = symbol & 1 + symbol >>>= 1 + price += GetPrice(this$static.Models[m], bit) + m = (m << 1) | bit + } + return price +} + +function ReverseEncode(Models, startIndex, rangeEncoder, NumBitLevels, symbol) { + var bit, + i, + m = 1 + for (i = 0; i < NumBitLevels; ++i) { + bit = symbol & 1 + $Encode_3(rangeEncoder, Models, startIndex + m, bit) + m = (m << 1) | bit + symbol >>= 1 + } +} + +function ReverseGetPrice(Models, startIndex, NumBitLevels, symbol) { + var bit, + i, + m = 1, + price = 0 + for (i = NumBitLevels; i != 0; --i) { + bit = symbol & 1 + symbol >>>= 1 + price += ProbPrices[(((Models[startIndex + m] - bit) ^ -bit) & 2047) >>> 2] + m = (m << 1) | bit + } + return price +} +function $DecodeBit(this$static, probs, index) { + var newBound, + prob = probs[index] + newBound = (this$static.Range >>> 11) * prob + if ((this$static.Code ^ -2147483648) < (newBound ^ -2147483648)) { + this$static.Range = newBound + probs[index] = ((prob + ((2048 - prob) >>> 5)) << 16) >> 16 + if (!(this$static.Range & -16777216)) { + this$static.Code = (this$static.Code << 8) | $read(this$static.Stream) + this$static.Range <<= 8 + } + return 0 + } else { + this$static.Range -= newBound + this$static.Code -= newBound + probs[index] = ((prob - (prob >>> 5)) << 16) >> 16 + if (!(this$static.Range & -16777216)) { + this$static.Code = (this$static.Code << 8) | $read(this$static.Stream) + this$static.Range <<= 8 + } + return 1 + } +} + +function $DecodeDirectBits(this$static, numTotalBits) { + var i, + t, + result = 0 + for (i = numTotalBits; i != 0; --i) { + this$static.Range >>>= 1 + t = (this$static.Code - this$static.Range) >>> 31 + this$static.Code -= this$static.Range & (t - 1) + result = (result << 1) | (1 - t) + if (!(this$static.Range & -16777216)) { + this$static.Code = (this$static.Code << 8) | $read(this$static.Stream) + this$static.Range <<= 8 + } + } + return result +} + +function $Init_8(this$static) { + this$static.Code = 0 + this$static.Range = -1 + for (var i = 0; i < 5; ++i) { + this$static.Code = (this$static.Code << 8) | $read(this$static.Stream) + } +} +function InitBitModels(probs) { + for (var i = probs.length - 1; i >= 0; --i) { + probs[i] = 1024 + } +} +var ProbPrices = (function() { + var end, + i, + j, + start, + ProbPrices = [] + for (i = 8; i >= 0; --i) { + start = 1 << (9 - i - 1) + end = 1 << (9 - i) + for (j = start; j < end; ++j) { + ProbPrices[j] = (i << 6) + (((end - j) << 6) >>> (9 - i - 1)) + } + } + return ProbPrices +})() + +function $Encode_3(this$static, probs, index, symbol) { + var newBound, + prob = probs[index] + newBound = (this$static.Range >>> 11) * prob + if (!symbol) { + this$static.Range = newBound + probs[index] = ((prob + ((2048 - prob) >>> 5)) << 16) >> 16 + } else { + this$static.Low = add( + this$static.Low, + and(fromInt(newBound), [4294967295, 0]) + ) + this$static.Range -= newBound + probs[index] = ((prob - (prob >>> 5)) << 16) >> 16 + } + if (!(this$static.Range & -16777216)) { + this$static.Range <<= 8 + $ShiftLow(this$static) + } +} + +function $EncodeDirectBits(this$static, v, numTotalBits) { + for (var i = numTotalBits - 1; i >= 0; --i) { + this$static.Range >>>= 1 + if (((v >>> i) & 1) == 1) { + this$static.Low = add(this$static.Low, fromInt(this$static.Range)) + } + if (!(this$static.Range & -16777216)) { + this$static.Range <<= 8 + $ShiftLow(this$static) + } + } +} + +function $GetProcessedSizeAdd(this$static) { + return add(add(fromInt(this$static._cacheSize), this$static._position), [ + 4, + 0 + ]) +} + +function $Init_9(this$static) { + this$static._position = P0_longLit + this$static.Low = P0_longLit + this$static.Range = -1 + this$static._cacheSize = 1 + this$static._cache = 0 +} + +function $ShiftLow(this$static) { + var temp, + LowHi = lowBits_0(shru(this$static.Low, 32)) + if (LowHi != 0 || compare(this$static.Low, [4278190080, 0]) < 0) { + this$static._position = add( + this$static._position, + fromInt(this$static._cacheSize) + ) + temp = this$static._cache + do { + $write(this$static.Stream, temp + LowHi) + temp = 255 + } while (--this$static._cacheSize != 0) + this$static._cache = lowBits_0(this$static.Low) >>> 24 + } + ++this$static._cacheSize + this$static.Low = shl(and(this$static.Low, [16777215, 0]), 8) +} + +function GetPrice(Prob, symbol) { + return ProbPrices[(((Prob - symbol) ^ -symbol) & 2047) >>> 2] +} +function decode(utf) { + var i = 0, + j = 0, + x, + y, + z, + l = utf.length, + buf = [], + charCodes = [] + for (; i < l; ++i, ++j) { + x = utf[i] & 255 + if (!(x & 128)) { + if (!x) { + // It appears that this is binary data, so it cannot be converted to a string, so just send it back. + return utf + } + charCodes[j] = x + } else if ((x & 224) == 192) { + if (i + 1 >= l) { + // It appears that this is binary data, so it cannot be converted to a string, so just send it back. + return utf + } + y = utf[++i] & 255 + if ((y & 192) != 128) { + // It appears that this is binary data, so it cannot be converted to a string, so just send it back. + return utf + } + charCodes[j] = ((x & 31) << 6) | (y & 63) + } else if ((x & 240) == 224) { + if (i + 2 >= l) { + // It appears that this is binary data, so it cannot be converted to a string, so just send it back. + return utf + } + y = utf[++i] & 255 + if ((y & 192) != 128) { + // It appears that this is binary data, so it cannot be converted to a string, so just send it back. + return utf + } + z = utf[++i] & 255 + if ((z & 192) != 128) { + // It appears that this is binary data, so it cannot be converted to a string, so just send it back. + return utf + } + charCodes[j] = ((x & 15) << 12) | ((y & 63) << 6) | (z & 63) + } else { + // It appears that this is binary data, so it cannot be converted to a string, so just send it back. + return utf + } + if (j == 16383) { + buf.push(String.fromCharCode.apply(String, charCodes)) + j = -1 + } + } + if (j > 0) { + charCodes.length = j + buf.push(String.fromCharCode.apply(String, charCodes)) + } + return buf.join('') +} +function encode(s) { + var ch, + chars = [], + data, + elen = 0, + i, + l = s.length + // Be able to handle binary arrays and buffers. + if (typeof s == 'object') { + return s + } else { + $getChars(s, 0, l, chars, 0) + } + // Add extra spaces in the array to break up the unicode symbols. + for (i = 0; i < l; ++i) { + ch = chars[i] + if (ch >= 1 && ch <= 127) { + ++elen + } else if (!ch || (ch >= 128 && ch <= 2047)) { + elen += 2 + } else { + elen += 3 + } + } + data = [] + elen = 0 + for (i = 0; i < l; ++i) { + ch = chars[i] + if (ch >= 1 && ch <= 127) { + data[elen++] = (ch << 24) >> 24 + } else if (!ch || (ch >= 128 && ch <= 2047)) { + data[elen++] = ((192 | ((ch >> 6) & 31)) << 24) >> 24 + data[elen++] = ((128 | (ch & 63)) << 24) >> 24 + } else { + data[elen++] = ((224 | ((ch >> 12) & 15)) << 24) >> 24 + data[elen++] = ((128 | ((ch >> 6) & 63)) << 24) >> 24 + data[elen++] = ((128 | (ch & 63)) << 24) >> 24 + } + } + return data +} +// s is dictionarySize +// f is fb +// m is matchFinder +// NOTE: Because some values are always the same, they have been removed. +// lc is always 3 +// lp is always 0 +// pb is always 2 +const modes = [ + { s: 16, f: 64, m: 0 }, + { s: 20, f: 64, m: 0 }, + { s: 19, f: 64, m: 1 }, + { s: 20, f: 64, m: 1 }, + { s: 21, f: 128, m: 1 }, + { s: 22, f: 128, m: 1 }, + { s: 23, f: 128, m: 1 }, + { s: 24, f: 255, m: 1 }, + { s: 25, f: 255, m: 1 } +] + +function get_mode_obj(mode) { + return modes[mode - 1] || modes[6] +} + +/** + * Compress a string with the LZMA algorithm + * + * @param {string} value The string to be compressed + * @param {object} options + * @param {1|2|3|4|5|6|7|8|9} options.mode Which mode to use (1 through 9, defaults to 7) + * @param {boolean} options.enableEndMark Whether to write an end mark + * @returns {string} + */ +export function compress(value, { mode = 7, enableEndMark = true } = {}) { + var this$static = {} + + this$static.c = $LZMAByteArrayCompressor( + {}, + encode(value), + get_mode_obj(mode), + enableEndMark + ) + while ($processChunk(this$static.c.chunker)); + return $toByteArray(this$static.c.output) +} + +/** + * Compress a string with the LZMA algorithm to URL-safe characters + * + * @param {string} value The string to be compressed + * @param {object} options + * @param {1|2|3|4|5|6|7|8|9} options.mode Which mode to use (1 through 9, defaults to 7) + * @param {boolean} options.enableEndMark Whether to write an end mark + * @returns {string} + */ +export function compressUrlSafe( + string, + { mode = 7, enableEndMark = true } = {} +) { + const compressedString = compress(string, { mode, enableEndMark }) + const compressedBytes = new Uint8Array(compressedString) + + return base64.encodeFromArrayUrlSafe(compressedBytes) +} + +/** + * Decompress a string compressed with the LZMA algorithm + * + * @param {number[]|Int8Array} bytes The int8 array created by the compress() function + * @returns {string} + */ +export function decompress(bytes) { + var this$static = {} + + this$static.d = $LZMAByteArrayDecompressor({}, bytes) + while ($processChunk(this$static.d.chunker)); + return decode($toByteArray(this$static.d.output)) +} + +/** + * Decompress a string compressed with the URL-safe compress function + * + * @param {string} string The URL-safe string generated by the compressUrlSafe() function + * @returns {string} + */ +export function decompressUrlSafe(string) { + return decompress(new Int8Array(base64.decodeToArrayUrlSafe(string))) +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..d63630bf --- /dev/null +++ b/package.json @@ -0,0 +1,9 @@ +{ + "name": "web-demo", + "version": "0.3.0", + "files": [ + "web_demo_bg.wasm", + "web_demo.js" + ], + "browser": "web_demo.js" +} \ No newline at end of file diff --git a/web_demo.js b/web_demo.js new file mode 100644 index 00000000..fca164f3 --- /dev/null +++ b/web_demo.js @@ -0,0 +1,511 @@ +let wasm_bindgen; +(function() { + const __exports = {}; + let script_src; + if (typeof document !== 'undefined' && document.currentScript !== null) { + script_src = new URL(document.currentScript.src, location.href).toString(); + } + let wasm = undefined; + + const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); + + if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; + + let cachedUint8ArrayMemory0 = null; + + function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; + } + + function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); + } + + const heap = new Array(128).fill(undefined); + + heap.push(undefined, null, true, false); + + let heap_next = heap.length; + + function addHeapObject(obj) { + if (heap_next === heap.length) heap.push(heap.length + 1); + const idx = heap_next; + heap_next = heap[idx]; + + heap[idx] = obj; + return idx; + } + +function getObject(idx) { return heap[idx]; } + +function dropObject(idx) { + if (idx < 132) return; + heap[idx] = heap_next; + heap_next = idx; +} + +function takeObject(idx) { + const ret = getObject(idx); + dropObject(idx); + return ret; +} + +function debugString(val) { + // primitive types + const type = typeof val; + if (type == 'number' || type == 'boolean' || val == null) { + return `${val}`; + } + if (type == 'string') { + return `"${val}"`; + } + if (type == 'symbol') { + const description = val.description; + if (description == null) { + return 'Symbol'; + } else { + return `Symbol(${description})`; + } + } + if (type == 'function') { + const name = val.name; + if (typeof name == 'string' && name.length > 0) { + return `Function(${name})`; + } else { + return 'Function'; + } + } + // objects + if (Array.isArray(val)) { + const length = val.length; + let debug = '['; + if (length > 0) { + debug += debugString(val[0]); + } + for(let i = 1; i < length; i++) { + debug += ', ' + debugString(val[i]); + } + debug += ']'; + return debug; + } + // Test for built-in + const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); + let className; + if (builtInMatches.length > 1) { + className = builtInMatches[1]; + } else { + // Failed to match the standard '[object ClassName]' + return toString.call(val); + } + if (className == 'Object') { + // we're a user defined class or Object + // JSON.stringify avoids problems with cycles, and is generally much + // easier than looping through ownProperties of `val`. + try { + return 'Object(' + JSON.stringify(val) + ')'; + } catch (_) { + return 'Object'; + } + } + // errors + if (val instanceof Error) { + return `${val.name}: ${val.message}\n${val.stack}`; + } + // TODO we could test for more things here, like `Set`s and `Map`s. + return className; +} + +let WASM_VECTOR_LEN = 0; + +const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } ); + +const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' + ? function (arg, view) { + return cachedTextEncoder.encodeInto(arg, view); +} + : function (arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; +}); + +function passStringToWasm0(arg, malloc, realloc) { + + if (realloc === undefined) { + const buf = cachedTextEncoder.encode(arg); + const ptr = malloc(buf.length, 1) >>> 0; + getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr; + } + + let len = arg.length; + let ptr = malloc(len, 1) >>> 0; + + const mem = getUint8ArrayMemory0(); + + let offset = 0; + + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 0x7F) break; + mem[ptr + offset] = code; + } + + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; + const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); + const ret = encodeString(arg, view); + + offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; + } + + WASM_VECTOR_LEN = offset; + return ptr; +} + +let cachedDataViewMemory0 = null; + +function getDataViewMemory0() { + if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { + cachedDataViewMemory0 = new DataView(wasm.memory.buffer); + } + return cachedDataViewMemory0; +} +/** + * @param {string} input + * @returns {Result} + */ +__exports.run_program = function(input) { + const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.run_program(ptr0, len0); + return Result.__wrap(ret); +}; + +__exports.start = function() { + wasm.start(); +}; + +function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + wasm.__wbindgen_exn_store(addHeapObject(e)); + } +} + +const ResultFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_result_free(ptr >>> 0, 1)); + +class Result { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(Result.prototype); + obj.__wbg_ptr = ptr; + ResultFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + ResultFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_result_free(ptr, 0); + } + /** + * @returns {string} + */ + get text() { + let deferred1_0; + let deferred1_1; + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.__wbg_get_result_text(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + deferred1_0 = r0; + deferred1_1 = r1; + return getStringFromWasm0(r0, r1); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + wasm.__wbindgen_free(deferred1_0, deferred1_1, 1); + } + } + /** + * @param {string} arg0 + */ + set text(arg0) { + const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + wasm.__wbg_set_result_text(this.__wbg_ptr, ptr0, len0); + } + /** + * @returns {string} + */ + get dot() { + let deferred1_0; + let deferred1_1; + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.__wbg_get_result_dot(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + deferred1_0 = r0; + deferred1_1 = r1; + return getStringFromWasm0(r0, r1); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + wasm.__wbindgen_free(deferred1_0, deferred1_1, 1); + } + } + /** + * @param {string} arg0 + */ + set dot(arg0) { + const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + wasm.__wbg_set_result_dot(this.__wbg_ptr, ptr0, len0); + } + /** + * @returns {string} + */ + get json() { + let deferred1_0; + let deferred1_1; + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.__wbg_get_result_json(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + deferred1_0 = r0; + deferred1_1 = r1; + return getStringFromWasm0(r0, r1); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + wasm.__wbindgen_free(deferred1_0, deferred1_1, 1); + } + } + /** + * @param {string} arg0 + */ + set json(arg0) { + const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + wasm.__wbg_set_result_json(this.__wbg_ptr, ptr0, len0); + } +} +__exports.Result = Result; + +async function __wbg_load(module, imports) { + if (typeof Response === 'function' && module instanceof Response) { + if (typeof WebAssembly.instantiateStreaming === 'function') { + try { + return await WebAssembly.instantiateStreaming(module, imports); + + } catch (e) { + if (module.headers.get('Content-Type') != 'application/wasm') { + console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); + + } else { + throw e; + } + } + } + + const bytes = await module.arrayBuffer(); + return await WebAssembly.instantiate(bytes, imports); + + } else { + const instance = await WebAssembly.instantiate(module, imports); + + if (instance instanceof WebAssembly.Instance) { + return { instance, module }; + + } else { + return instance; + } + } +} + +function __wbg_get_imports() { + const imports = {}; + imports.wbg = {}; + imports.wbg.__wbg_log_d0d3f3b59b02e988 = function(arg0, arg1, arg2, arg3) { + log(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3)); + }; + imports.wbg.__wbindgen_string_new = function(arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_object_drop_ref = function(arg0) { + takeObject(arg0); + }; + imports.wbg.__wbg_new_abda76e883ba8a5f = function() { + const ret = new Error(); + return addHeapObject(ret); + }; + imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) { + const ret = getObject(arg1).stack; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + console.error(getStringFromWasm0(arg0, arg1)); + } finally { + wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); + } + }; + imports.wbg.__wbg_error_53abcd6a461f73d8 = function(arg0) { + console.error(getObject(arg0)); + }; + imports.wbg.__wbg_now_d3cbc9581625f686 = function(arg0) { + const ret = getObject(arg0).now(); + return ret; + }; + imports.wbg.__wbindgen_object_clone_ref = function(arg0) { + const ret = getObject(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_newnoargs_1ede4bf2ebbaaf43 = function(arg0, arg1) { + const ret = new Function(getStringFromWasm0(arg0, arg1)); + return addHeapObject(ret); + }; + imports.wbg.__wbg_get_ef828680c64da212 = function() { return handleError(function (arg0, arg1) { + const ret = Reflect.get(getObject(arg0), getObject(arg1)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_call_a9ef466721e824f2 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).call(getObject(arg1)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_self_bf91bf94d9e04084 = function() { return handleError(function () { + const ret = self.self; + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_window_52dd9f07d03fd5f8 = function() { return handleError(function () { + const ret = window.window; + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_globalThis_05c129bf37fcf1be = function() { return handleError(function () { + const ret = globalThis.globalThis; + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_global_3eca19bb09e9c484 = function() { return handleError(function () { + const ret = global.global; + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbindgen_is_undefined = function(arg0) { + const ret = getObject(arg0) === undefined; + return ret; + }; + imports.wbg.__wbindgen_debug_string = function(arg0, arg1) { + const ret = debugString(getObject(arg1)); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbindgen_throw = function(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); + }; + + return imports; +} + +function __wbg_init_memory(imports, memory) { + +} + +function __wbg_finalize_init(instance, module) { + wasm = instance.exports; + __wbg_init.__wbindgen_wasm_module = module; + cachedDataViewMemory0 = null; + cachedUint8ArrayMemory0 = null; + + + wasm.__wbindgen_start(); + return wasm; +} + +function initSync(module) { + if (wasm !== undefined) return wasm; + + + if (typeof module !== 'undefined') { + if (Object.getPrototypeOf(module) === Object.prototype) { + ({module} = module) + } else { + console.warn('using deprecated parameters for `initSync()`; pass a single object instead') + } + } + + const imports = __wbg_get_imports(); + + __wbg_init_memory(imports); + + if (!(module instanceof WebAssembly.Module)) { + module = new WebAssembly.Module(module); + } + + const instance = new WebAssembly.Instance(module, imports); + + return __wbg_finalize_init(instance, module); +} + +async function __wbg_init(module_or_path) { + if (wasm !== undefined) return wasm; + + + if (typeof module_or_path !== 'undefined') { + if (Object.getPrototypeOf(module_or_path) === Object.prototype) { + ({module_or_path} = module_or_path) + } else { + console.warn('using deprecated parameters for the initialization function; pass a single object instead') + } + } + + if (typeof module_or_path === 'undefined' && typeof script_src !== 'undefined') { + module_or_path = script_src.replace(/\.js$/, '_bg.wasm'); + } + const imports = __wbg_get_imports(); + + if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) { + module_or_path = fetch(module_or_path); + } + + __wbg_init_memory(imports); + + const { instance, module } = await __wbg_load(await module_or_path, imports); + + return __wbg_finalize_init(instance, module); +} + +wasm_bindgen = Object.assign(__wbg_init, { initSync }, __exports); + +})(); diff --git a/web_demo_bg.wasm b/web_demo_bg.wasm new file mode 100644 index 00000000..b9058013 Binary files /dev/null and b/web_demo_bg.wasm differ diff --git a/worker.js b/worker.js new file mode 100644 index 00000000..2508619d --- /dev/null +++ b/worker.js @@ -0,0 +1,29 @@ +importScripts("web_demo.js") +console.log("I'm in the worker") + +let { run_program } = wasm_bindgen; +async function work() { + await wasm_bindgen("web_demo_bg.wasm"); + + // Set callback to handle messages passed to the worker. + self.onmessage = async event => { + try { + logbuffer = []; + let result = run_program(event.data); + console.log("Got result from worker", result); + // Can't send the result directly, since it contains a reference to the + // wasm memory. Instead, we send the dot and text separately. + self.postMessage({ dot: result.dot, text: result.text, log: logbuffer, json: result.json }); + } catch (error) { + console.log(error); + self.postMessage({ dot: "", text: "Something panicked! Check the console logs...", log: logbuffer, json: "{}" }); + } + }; +} + +logbuffer = []; +function log(level, str) { + logbuffer.push([level, str]); +} + +work()