Today, we started to accept external contributions to the Z3 code base. First, I'd like to emphasize that Z3 does not have a liberal license such as GPL or Apache. The source code is available, but it cannot be used for commercial purposes. Moreover, if we read the license carefully, item 3 says that Microsoft can use external contributions for commercial purposes. It is understandable that some may think this is a unfair clause. If you do not agree with the license terms, please do not contribute any code.
We initially did not want to accept external contributions. The main issue was that some Z3 internal users have strict
rules against external contributions. They can only use code bases that were implemented by Microsoft employees and/or contractors.
However, as we gained experience with git, it became clear that we can easily maintain a
containing only internal contributions, and the
master branch with internal and external contributions.
Now, the 4 main branches in the Z3 project are
masterthe official branch containing internal and external contributions.
purethe official branch for internal users that cannot use external contributions.
unstablethe branch for working in progress being done by the Z3 team.
contribthe branch for new external contributions and new changes from
Remark: We also have other branches for experimental features we are working on.
Our plan is to use the following work-flow. The Z3 team works on the
unstable branch. When the code in the
unstable branch becomes "stable",
it is merged into the
pure branch. External contributors submit "pull requests" to the
contrib branch. When the changes in
contrib are stable, they are merged into the
The Z3 code base is big and not very well documented. So, it is hard to make contributions to the main engines. At this point, it is more realistic to target contributions such as
In future blog posts, I'm planning to describe the main data-structures used in Z3, and how to add more complicated functionality.
I suggest anybody interested in submitting code to contact a Z3 team member before investing time working on it.
The idea is to coordinate where the contribution will fit in the project, the scope, and how it will integrate with the other components.
Important: Please, do not submit bug fixes using pull requests. Instead submit a bug report using the issue tracker. Feel free to describe a potential fix.
Here are some instructions on how to fork, modify and submit your modifications to the Z3 project.
Make sure you have git installed in your system.
Fork the Z3 code base. You just have to click the Fork link as described below.
git. In the following command, the option
-b contribis used to retrieve the
contribbranch. Note that you have to replace
leodemourawith your username, and
z3expwith the name you used for your Fork.
git clone https://git01.codeplex.com/forks/leodemoura/z3exp -b contrib
Remark: CodePlex requires git 1.7.10 or later to avoid HTTPS cloning errors. If you are using an older version of git, you might get an error. If that is your case, here are some instructions on how to fix it.
... modify/create files ... git commit -a -s -m "my modifications" git push
You are essentially submitting your changes in the
contrib branch (in your Fork) to the
contrib branch in the Z3 code base.
You have to make sure that the
to branches are selected correctly like in the following example.