Closed cgyurgyik closed 6 months ago
With BACKTRACE=1,
stack backtrace:
0: rust_begin_unwind
at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:595:5
1: core::panicking::panic_fmt
at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/panicking.rs:67:14
2: egraph_cargo::main::{{closure}}
at ./src/main.rs:18:29
3: core::result::Result<T,E>::unwrap_or_else
at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/result.rs:1429:23
4: egraph_cargo::main
at ./src/main.rs:16:5
5: core::ops::function::FnOnce::call_once
at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
I was not able to reproduce this behavior. With the program you provided, I got error Arity mismatch, expected 2 args: (ISet-length $IS1)
.
Getting rid of the second parameter to ISet-length, the program runs as expected.
(sort ISetBase (Set i64))
; Reify set
(sort ISet)
(function IS (ISetBase) ISet)
(function ISet-length (ISet) i64 :unextractable)
(rule ((IS x))
((set (ISet-length (IS x)) (set-length x))))
(let myset (IS (set-of 2 4 1 4 -1)))
(run 100)
(check (= 4 (ISet-length myset)))
Maybe you are using an older version of egglog?
Trying to build a smaller repro from the toy example, this leads to the following error with
egglog 0.1.0
: