0

Consider the following digital logic circuit, which has multiple inputs and one output:

Digital logic circuit drawn using Logisim

The logic circuit above can be represented in tree form:

Tree drawn using Graphviz

This tree representation could then be used in a tree-based genetic programming framework to evolve the circuit. For example, this tree could be represented as a Lisp list (or (and A B) (not C)), which could then be used with the Little LISP genetic programming framework from John R. Koza's Genetic Programming textbook.

However, I now want to deal with digital logic circuits that have more than one output. For example, in the half-adder circuit below, there are two outputs S and C, each of which is affected by both inputs A and B.

Half adder

(Image source: SICP by Abelson et al. Section 3.3.4 A Simulator for Digital Circuits. CC BY-SA 4.0)

How do I represent and evolve such a circuit in tree-based genetic programming? How do I represent the circuit above as a tree that could then be used to evolve the circuit using a tree-based genetic programming framework?

Flux
  • 9,805
  • 5
  • 46
  • 92
  • Cross posted to the AI Stack Exchange: [How to represent multiple-output logic circuits in tree-based genetic programming](https://ai.stackexchange.com/questions/34549/how-to-represent-multiple-output-logic-circuits-in-tree-based-genetic-programmin) – Flux Feb 16 '22 at 09:59

1 Answers1

0

I worked in a similar problem in a different field, but I think you could have a quite straightforward solution by instead of using a binary tree using a tree represented by list of lists.

For instance, in each level of the tree instead of having {1,2} possible values, having {1,...,n}, this way you could represent any possible combination.

EDIT:

Sorry, I have been mistaken since I did not realize some of the circuits connect between themselves, even with non-binary trees cannot be done.

Probably the only possible representation in your case is actually a graph, which could be represented the following way: circuit graph representation

The only problem I see is that in order to evolve this kind of representation, you should define the proper crossover, mutation operations, etc. feasible for your problem. For instance, if you always want your input to be S, B and output A, B you should be careful while defining the genetic operations not to be able to mutate or crossover those.

So, I would define each circuit as a graph, define the objective function, and some custom genetic operations so that you can just perform feasible operations. I bet some logic circuits will have different amount of output sizes, then, you should be careful and design a way to cope with that problem.

Javiagu13
  • 26
  • 6
  • How exactly? Could you give a concrete example representation of the half-adder circuit shown in the question? – Flux Feb 22 '22 at 12:27
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 22 '22 at 13:34
  • Added an edit above, actually what you need is a graph. – Javiagu13 Feb 22 '22 at 14:25