ninetynine-1.3.0: Ninety-Nine Haskell Problems
CopyrightCopyright (C) 2021 Yoo Chung
LicenseGPL-3.0-or-later
Maintainerdev@chungyc.org
Safe HaskellSafe-Inferred
LanguageGHC2021

Solutions.P47

Description

Some solutions to Problems.P47 of Ninety-Nine Haskell Problems.

Synopsis

Documentation

evaluateCircuit :: [(Int, Int)] -> Bool -> Bool -> Bool Source #

Evaluates a logic circuit.

buildCircuit :: (Bool -> Bool -> Bool) -> [(Int, Int)] Source #

Returns a logic circuit composed of NAND gates which computes a given a binary boolean function. The logic circuit should be in a form which evaluateCircuit can evaluate.