# Create a context
=
# Create a graph in a given context that will be used for matrix multiplication
=
# For each millionaire, add input nodes to the empty graph g created above.
# Input nodes are instantiated with binary arrays of 32 bits.
# This should be enough to represent the wealth of each millionaire.
=
=
# Millionaires' problem boils down to computing the greater-than (>) function.
# In CipherCore, comparison functions are realized via custom operations,
# which are a special kind of operations that accept varying number of inputs and input types.
# To add a custom operation node to the graph, create it first.
# Note that the GreaterThan custom operation has a Boolean parameter that indicates whether input binary arrays represent signed integers
=
# Add custom operation to the graph specifying the custom operation and its arguments: `first_millionaire` and `second_millionaire`.
# This operation will compute the bit `(first_millionaire > second_millionaire)`.
=
# Before computation, every graph should be finalized, which means that it should have a designated output node.
# This can be done by calling `g.set_output_node(output)?` or as below.
# Set this graph as main to be able to finalize the context
# Serialize the context and print it to stdout