Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BDD MLE, modular compilation, alg. data types, M1 compatibility #136

Merged
merged 89 commits into from
May 12, 2023
Merged

Conversation

rtjoa
Copy link
Contributor

@rtjoa rtjoa commented May 10, 2023

Nearly all of the LOC changed are due to added examples. To see how the backend changed, start with the explanations of includes at the bottom of src/inference/inference.jl.

BDD MLE

See examples/qc/tour_2_learning.jl.

Modular compilation

The separation of WMC, BDD compilation, and pr supports BDD MLE. For an example that provides more general motivation, see the following function, which efficiently finds the exact max value of a DistUInt:

function maxvalue(x::DistUInt{W}) where W
    c = BDDCompiler(x.bits)
    v = 0
    ctx = true
    for i = 1:W
        bit, bitvalue = x.bits[i], 2^(W-i)
        if issat(c.mgr, compile(c, ctx & bit))
            ctx &= bit
            v += bitvalue
        end
    end
    v
end

Algebraic data types

See src/dist/inductive/list.jl for an example definition of an algebraic datatypes and test/dist/inductive/list_test.jl for its usage.

M1 compatibility

I ripped out TikzGraphs and TikzPictures (which depend on Tectonic, see this issue), and added a pointer to rtjoa/CUDD.jl:m1compat in the README.

@rtjoa rtjoa requested review from guyvdbroeck and PoorvaGarg May 10, 2023 19:13
@guyvdbroeck guyvdbroeck merged commit 6c1bc64 into main May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants