śĪ."Ł      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×Ų(c) Galois, Inc. 2014-2017BSD3jhendrix@galois.com experimentalportableSafe &'345>?AQVMĖ8§A basic AIG literal datastructure based on LitTrees. This is a totally naive implementation of the AIG structure that exists exclusively for testing purposes.A basic Graph’ datastructure based on LitTrees. This is a totally naive implementation of the AIG structure that exists exclusively for testing purposes.Result of a verification check.Satisfiability check result. BSome graph quantifies over the state phantom variable for a graph. qA network is an and-invertor graph paired with it's outputs, thus representing a complete combinational circuit.BAn And-Inverter-Graph is a data structure storing bit-level nodes.ßGraphs are and-inverter graphs, which contain a number of input literals and Boolean operations for creating new literals. Every literal is part of a specific graph, and literals from different networks may not be mixed.»Both the types for literals and graphs must take a single phantom type for an arugment that is used to ensure that literals from different networks cannot be used in the same operation.?Create a temporary graph, and use it to compute a result value.6Build a new graph instance, and packge it into the  . type that remembers the IsAIG implementation.6Read an AIG from a file, assumed to be in Aiger format7Get unique literal in graph representing constant true.8Get unique literal in graph representing constant false.!Generate a constant literal valueRReturn if the literal is a fixed constant. If the literal is symbolic, return Nothing.Generate a fresh input literal'Compute the logical and of two literals+Build the conjunction of a list of literals&Compute the logical or of two literals,Compute the logical equality of two literals/Compute the logical implication of two literals(Compute the exclusive or of two literals)Perform a mux (if-then-else on the bits).%Return number of inputs in the graph.&Get input at given index in the graph.  Write network out to AIGER file.!GWrite network out to AIGER file with some inputs designated as latches."lWrite network out to DIMACS CNF file. Returns vector mapping combinational inputs to CNF Variable numbers.#+Check if literal is satisfiable in network.$+Perform combinational equivalence checking.%1Evaluate the network on a set of concrete inputs.&1Evaluate the network on a set of concrete inputs.'JExamine the outermost structure of a literal to see how it was constructed(IBuild an evaluation function over an AIG using the provided view function)_A proxy is used to identify a specific AIG instance when calling methods that create new AIGs.,Negate a literal.-“Tests whether two lits are identical. This is only a syntactic check, and may return false even if the two literals represent the same predicate.1EConcrete datatype representing the ways an AIG can be constructed.9;Evaluate the given literal using the provided view function:DEvaluate the given list of literals using the provided view function;8Build an AIG literal by unfolding a constructor function<@Build a list of AIG literals by unfolding a constructor function=2Extract a tree representation of the given literal>3Construct an AIG literal from a tree representation?>Extract a forest representation of the given list of literal s@=Construct a list of AIG literals from a forest representationA^Short-cutting mux operator that optimizes the case where the test bit is a concrete literalB5Get number of inputs associated with current network.C,Number of outputs associated with a network.ŁUnpack  SomeGraph7 in a local scope so it can be used to compute a resultD7Convert a sat result to a verify result by negating it.E7Convert a verify result to a sat result by negating it.FGenerate an arbitrary 1 given a generator for aGGenerate an arbitrary .HjGiven a LitTree, calculate the maximum input number in the tree. Returns 0 if no inputs are referenced.I>Given a list of LitTree, construct a corresponding AIG networkJ/Generate a random network by building a random .* and using that to construct a network.A )C value, used for selecting the concrete implementation typeclass The AIG graph computation to runM & !"#$%'()*+-,./0123456789:;<=>?@ABCDEFGHIJKLM+,- !"#$%&'(A)* BC12345678./0=>?@9:;< EDFGHIJKL ŚŪ    !"#$%&'()*+,-./01234567(c) Galois, Inc. 2014BSD3jhendrix@galois.com experimentalportableNone345Vų4[^„A BitVector consists of a sequence of symbolic bits and can be used for symbolic machine-word arithmetic. Bits are stored in most-significant-bit first order._Empty bitvector`Number of bits in a bit vectoraGenerate a bitvector of length n, using function f0 to specify the bit literals. The indexes to f% are given in LSB-first order, i.e., f 0 is the least significant bit.bGenerate a bitvector of length n, using monadic function f1 to generate the bit literals. The indexes to f% are given in LSB-first order, i.e., f 0 is the least significant bit.cGenerate a bitvector of length n, using function f0 to specify the bit literals. The indexes to f% are given in MSB-first order, i.e., f 0 is the most significant bit.dGenerate a bitvector of length n, using monadic function f1 to generate the bit literals. The indexes to f% are given in MSB-first order, i.e., f 0 is the most significant bit.e Generate a bit vector of length n" where every bit value is literal l.f Generate a bit vector of length n/ where every bit value is generated in turn by m.g=Generate a one-element bitvector containing the given literalh/Project the individual bits of a BitVector. x h 0P is the most significant bit. It is an error to request an out-of-bounds bit.iGAppend two bitvectors, with the most significant bitvector given first.jaConcatenate a list of bitvectors, with the most significant bitvector at the head of the list.kProject out the n( most significant bits from a bitvector.l Drop the n( most significant bits from a bitvector.mExtract n bits starting at index i&. The vector must contain at least i+n elementsnExtract n bits starting at index ig, counting from the end of the vector instead of the beginning. The vector must contain at least i+n elements.o.Combine two bitvectors with a bitwise functionp>Combine two bitvectors with a bitwise monadic combiner action.q:Convert a bitvector to a list, most significant bit first.r=Convert a list to a bitvector, assuming big-endian bit order.sJSelect bits from a bitvector, starting from the least significant bit. x ! 0Q is the least significant bit. It is an error to request an out-of-bounds bit.tpDisplay a bitvector as a string of bits with most significant bits first. Concrete literals are displayed as '0' or '1'-, whereas symbolic literals are displayed as x.uPGenerate a bitvector from an integer value, using 2's complement representation.v6Interpret a bitvector as an unsigned integer. Return Nothing% if the bitvector is not concrete.w3Interpret a bitvector as a signed integer. Return Nothing% if the bitvector is not concrete.x1Retrieve the most significant bit of a bitvector.y2Retrieve the least significant bit of a bitvector.z'If-then-else combinator for bitvectors.{ÆIf-then-else combinator for bitvector computations with optimistic shortcutting. If the test bit is concrete, we can avoid generating either the if or the else circuit.|Lazy negation of a circuit.~ƒBuild a short-cut OR circuit. If the left argument evaluates to the constant true, the right argument will not be evaluated.€hConstruct a lazy equality test. If both arguments are constants, the output will also be a constant.‚…Build a short-cut AND circuit. If the left argument evaluates to the constant false, the right argument will not be evaluated.…^Construct a lazy xor. If both arguments are constants, the output will also be a constant.ÜAA half adder which takes two inputs and returns output and carry.ŻCA full adder which takes three inputs and returns output and carry.ŽVImplements a ripple carry adder. Both addends are assumed to have the same length.ßLA subtraction circuit which takes three inputs and returns output and carry.ą:Subtract two bit vectors, returning result and borrow bit.į-Compute just the borrow bit of a subtraction.†2Compute the 2's complement negation of a bitvector‡:Add two bitvectors with the same size. Discard carry bit.ˆ1Add two bitvectors with the same size with carry.‰KSubtract one bitvector from another with the same size. Discard carry bit.ŠBSubtract one bitvector from another with the same size with carry.‹#Add a constant value to a bitvectorŒ#Add a constant value to a bitvector€Multiply two bitvectors with the same size, with result of the same size as the arguments. Overflow is silently discarded.Ž+Unsigned multiply two bitvectors with size m and size n#, resulting in a vector of size m+n.)Signed multiply two bitvectors with size m and size n#, resulting in a vector of size m+n.HCompute the signed quotient of two signed bitvectors with the same size.‘RCompute the signed division remainder of two signed bitvectors with the same size.ā>Cons value to head of a list and shift other elements to left.’*Return absolute value of signed bitvector.ćBitblast version of unsigned quotRem.“LCompute the unsigned quotient of two unsigned bitvectors with the same size.”VCompute the unsigned division remainder of two unsigned bitvectors with the same size.•4Test syntactic equalify of two bitvectors using the - operation–3Test equality of two bitvectors with the same size.—$Test if a bitvector is equal to zero˜)Test if a bitvector is distinct from zero™3Unsigned less-than on bitvector with the same size.š<Unsigned less-than-or-equal on bitvector with the same size.›1Signed less-than on bitvector with the same size.œ:Signed less-than-or-equal on bitvector with the same size.sext v n sign extends v to be a vector with length n. This function requires that  n >= length v and  length v > 0.ž zext g v n zero extends v to be a vector with length n. This function requires that  n >= length v.Ÿ5Truncate the given bit vector to the specified length HTruncate or zero-extend a bitvector to have the specified number of bits”HTruncate or sign-extend a bitvector to have the specified number of bits¢&muxInteger mergeFn maxValue lv valueFn$ returns a circuit whose result is  valueFn v when lv has value v.£1Shift left. The least significant bit becomes 0.äShift left by a constant.åShift right by a constant.¤8Signed right shift. The most significant bit is copied.„:Unsigned right shift. The most significant bit becomes 0.ęRotate left by a constant.ēRotate right by a constant.¦ Rotate left.§ Rotate right.Ø’Compute the rounded-down base2 logarithm of the input bitvector. For x > 0, this uniquely satisfies 2^(logBase2_down(x)) <= x < 2^(logBase2_down(x)+1). For x = 0, we set logBase2(x) = -1. The output bitvector has the same width as the input bitvector.©ŻCompute the rounded-up base2 logarithm of the input bitvector. For x > 1, this uniquely satisfies 2^(logBase2_up(x) - 1) < x <= 2^(logBase2_up(x)). For x = 1, logBase2_up 1 = 0. For x = 0, we get logBase2_up 0 =  inputbitvector lengthŅ; this just happens to work out from the defining fomula `logBase2_up x = logBase2_down (x-1) + 1` when interpreted in 2's complement. The output bitvector has the same width as the input bitvector.Ŗ’rCount the number of leading zeros in the input vector; that is, the number of more-significant digits set to 0 above the most significant digit that is set. If the input vector is 0, the output of this function is the length of the bitvector (i.e., all digits are counted as leading zeros). The output bitvector has the same width as the input bitvector.«’vCount the number of trailing zeros in the input vector; that is, the number of less-significant digits set to 0 below the least significant digit which is set. If the input vector is 0, the output of this function is the length of the bitvector (i.e., all digits are counted as trailing zeros). The output bitvector has the same width as the input bitvector.čžGiven positive x, find the unique i such that: 2^i <= x < 2^(i+1) This is the floor of the lg2 function. We extend the function so intLog2_down 0 = -1.é‡Given positive x, find the unique i such that: 2^(i-1) < x <= 2^i This is the ceiling of the lg2 function. Note: intLog2_up 1 = 0¬’śPriority encoder. Given a bitvector, calculate the bit position of the most-significant 1 bit, with position 0 corresponding to the least-significant-bit. Return the "valid" bit, which is set iff at least one bit in the input is set; and the calcuated bit position. If no bits are set in the input (i.e. if the valid bit is false), the calculated bit position is zero. The indicated bitwidth must be large enough to hold the answer; in particular, we must have (length bv <= 2^w).­‰Polynomial multiplication. Note that the algorithm works the same no matter which endianness convention is used. Result length is  max 0 (m+n-1), where m and n are the lengths of the inputs.®æPolynomial mod with symbolic modulus. Return value has length one less than the length of the modulus. This implementation is optimized for the (common) case where the modulus is concrete.ÆLPolynomial division. Return value has length equal to the first argument.an#, length of the generated bitvectorf$, function to calculate bit literalsbn#, length of the generated bitvectorf', computation to generate a bit literalźn#, length of the generated bitvectorf', computation to generate a bit literalcn#, length of the generated bitvectorf$, function to calculate bit literalsdn#, length of the generated bitvectorf', computation to generate a bit literalen, length of the bitvectorl, the value to replicatefn, length of the bitvectorm&, the computation to produce a literalmi, 0-based start indexn, bits to take%a vector consisting of the bits from i to i+n-1ni0, 0-based start index from the end of the vectorn, bits to takeu)number of bits in the resulting bitvector integer valueztest bitthen bitvectorelse bitvector{test bitthen circuit computationelse circuit computationŽsum and carry-out bit¢.Maximum value input vector is allowed to take. Input vector£the value to shifthow many places to shift¤the value to shifthow many places to shift„the value to shifthow many places to shift¦the value to rotatehow many places to rotate§the value to rotatehow many places to rotateØinput bitvector©input bitvectorŖinput bitvector«input bitvector¬width of the output bitvectorinput bitvector Valid bit and position bitvectorėwidth of the output bitvectorinput bitvectorR^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®ÆR^_`hsijklmnopxy•tdcbaefur¢g‚ƒ~…„€|}z{vwq†‡ˆ‰Š‹ŒŽ‘“”£¤„¦§–—˜œ›š™’žŸ ”¬Ø©Ŗ«­Æ®^ģķ(c) Galois, Inc. 2014BSD3jhendrix@galois.com experimentalportableNoneüŸ & !"#$%'()*+-,./0123456789:;<=>?@ABCDEFGHIJKL^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ(c) Galois, Inc. 2014BSD3jhendrix@galois.com experimentalportableNone;=>?AFQV¶·ø¹ŗ»½¼¾æĄĮĆĀÄÅĘĒČ#ĮĀĆ¾æĄŗ»¼½ÄÅĘĒĖŹÉø¹¶·ŠĻĪĶŲ×ÖÕŌÓŅŃČ̶·ø¹ŗ»¼½¾æĄĮĀĆī      !"#$%&'()*+,,-./00123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»»¼½¾¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēč_éź aig-0.2.6-KVHkjD5ch2YIRGu8kWbno9Data.AIG.InterfaceData.AIG.OperationsData.AIG.TraceData.AIGBasicLit BasicGraph VerifyResultValidInvalid VerifyUnknown SatResultUnsatSat SatUnknown SomeGraphNetworkIsAIG withNewGraphnewGraph aigerNetworktrueLitfalseLitconstant asConstantnewInputandandsoreqimpliesxormux inputCountgetInput writeAigerwriteAigerWithLatcheswriteCNFcheckSatcec evaluatorevaluatelitViewabstractEvaluateAIGProxyIsLitnot===LitTree unLitTreeLitViewAndNotAndInputNotInputTrueLitFalseLit negateLitViewfoldAIGfoldAIGs unfoldAIG unfoldAIGs toLitTree fromLitTree toLitForest fromLitForestlazyMuxnetworkInputCountnetworkOutputCounttoVerifyResult toSatResult genLitView genLitTree getMaxInput buildNetwork randomNetwork basicProxy newBasicGraph$fArbitraryLitTree$fIsAIGBasicLitBasicGraph$fIsLitBasicLit $fEqLitView $fShowLitView $fOrdLitView$fFunctorLitView$fFoldableLitView$fTraversableLitView $fEqLitTree $fShowLitTree $fOrdLitTree $fEqSatResult$fShowSatResult$fEqVerifyResult$fShowVerifyResult$fShowBasicLitBVemptylength generate_lsb0generateM_lsb0 generate_msb0generateM_msb0 replicate replicateM singletonat++concattakedropslicesliceRevzipWithzipWithMbvToList bvFromList!bvShow bvFromInteger asUnsignedasSignedmsblsbiteiteMlNotlNot'lOrlOr'lEqlEq'lAndlAnd'lXor'lXornegaddaddCsubsubCaddConstsubConstmulmulFullsmulFullsquotsremsabsuquoturembvSamebvEqisZerononZeroultulesltslesextzexttrunc zeroIntCoerce signIntCoerce muxIntegershlsshrushrrolror logBase2_down logBase2_upcountLeadingZeroscountTrailingZerospriorityEncodepmulpmodpdiv$fEqBV$fOrdBV$fShowBV $fFunctorBV $fFoldableBV$fTraversableBV TraceOutput traceOutputTraceOptraceOp TraceGraphtGraphtActiveTraceLit unTraceLit Traceable compareLitshowLitproxyactivateTracingdeactiveTracing withTracingwithNewGraphTracing $fOrdTraceLit $fEqTraceLit$fIsLitTraceLit$fIsAIGTraceLitTraceGraph$fTraceOplg(->)$fTraceOplg(->)0$fTraceOplg(->)1$fTraceOplg(->)2$fTraceOutputlgLitView$fTraceOutputlgVerifyResult$fTraceOutputlgSatResult$fTraceOutputlg()$fTraceOutputlgInt$fTraceOutputlgTraceLit$fTraceOutputlg[] $fTraceOplgIO withSomeGraph halfAdder fullAdder ripple_addfullSub ripple_subripple_sub_borrowshiftL1uquotRemshlCshrCrolCrorC intLog2_down intLog2_upgenerateM_scan_lsb0doPriorityEncodeunBV