|
1 | 1 | // Create wrappers around input types so that convert from pyobjects to them |
2 | 2 | // and then from them to the egg_smol types |
3 | 3 | use crate::utils::*; |
| 4 | +use egglog::extract::DefaultCost; |
4 | 5 | use ordered_float::OrderedFloat; |
5 | 6 | use pyo3::prelude::*; |
6 | 7 | use pyo3::types::{PyDelta, PyDeltaAccess}; |
@@ -258,7 +259,7 @@ convert_enums!( |
258 | 259 | Include(span: Span, path: String) |
259 | 260 | i -> egglog::ast::Command::Include(i.span.clone().into(), (&i.path).into()), |
260 | 261 | egglog::ast::Command::Include(span, p) => Include { span: span.into(), path: p.to_string() }; |
261 | | - Constructor(span: Span, name: String, schema: Schema, cost: Option<usize>, unextractable: bool) |
| 262 | + Constructor(span: Span, name: String, schema: Schema, cost: Option<DefaultCost>, unextractable: bool) |
262 | 263 | c -> egglog::ast::Command::Constructor { |
263 | 264 | span: c.span.clone().into(), |
264 | 265 | name: (&c.name).into(), |
@@ -325,7 +326,7 @@ convert_enums!( |
325 | 326 | egglog::ast::Subdatatypes::NewSort(name, args) => NewSort { name: name.to_string(), args: args.iter().map(|e| e.into()).collect() } |
326 | 327 | }; |
327 | 328 | egglog::ExtractReport: "{:?}" => ExtractReport { |
328 | | - Best(termdag: TermDag, cost: usize, term: Term) |
| 329 | + Best(termdag: TermDag, cost: DefaultCost, term: Term) |
329 | 330 | b -> egglog::ExtractReport::Best { |
330 | 331 | termdag: (&b.termdag).into(), |
331 | 332 | cost: b.cost, |
@@ -384,7 +385,7 @@ convert_struct!( |
384 | 385 | span: Span, |
385 | 386 | name: String, |
386 | 387 | types: Vec<String>, |
387 | | - cost: Option<usize> = None |
| 388 | + cost: Option<DefaultCost> = None |
388 | 389 | ) |
389 | 390 | v -> egglog::ast::Variant {span: v.span.clone().into(), name: (&v.name).into(), types: v.types.iter().map(|v| v.into()).collect(), cost: v.cost}, |
390 | 391 | v -> Variant {span: v.span.clone().into(), name: v.name.to_string(), types: v.types.iter().map(|v| v.to_string()).collect(), cost: v.cost}; |
|
0 commit comments