Tractables / Dice.jl

Apache License 2.0
17 stars 4 forks source link

support `max` of `DistInt` #7

Open guyvdbroeck opened 2 years ago

guyvdbroeck commented 2 years ago
code = @dice begin

    function uniform(bitrange::Int, bitwidth::Int)
        ans = fill(DistBool(dicecontext(), false), bitwidth)
        for i = 1:bitrange
            ans[i] = flip(0.5)
        end
        DistInt(ans)
    end

    a = uniform(3, 4)
    b = uniform(3, 4)
    max(a,b)
end

infer(code, :bdd)
ERROR: MethodError: no method matching isless(::DistInt, ::DistInt)
PoorvaGarg commented 1 month ago

This issue is resolved in hybit-merge-main #198 and will be closed when the branch is merged.