The algorithm is still incomplete and there are many unused funcs I though would be required.
A + B
means ANDA | B
means ORA ^ B
means XOR!A
means NOTA | B => C + D
means ifA
orB
are true, thenC
andD
are also trueX ^ (A | B) => !K
means if left side is true, thenK
is certainly false=AJK
describes initial facts, in this caseA
,J
,K
are true?XY
says that we want to know whetherX
andY
are true
Example of program input and output:
A => J ^ K
B => X ^ Y
J + !K => !A | C
C => D
=A
?D
( true: A unknown: D )
Using C => D
( true: A unknown: C, D )
Using C => D
No match
Using J + !K => !A | C
( true: A unknown: C, D, J, K )
Using C => D
No match
Using J + !K => !A | C
No match
Using A => J ^ K
2 possible outcomes
Trying with ( true: J false: K )
( true: A, J false: K unknown: C, D )
Using C => D
No match
Using J + !K => !A | C
3 possible outcomes
Trying with ( false: A )
Conflict
Trying with ( true: C )
( true: A, C, J false: K unknown: D )
Using C => D
1 possible outcome
Trying with ( true: D )
( true: A, C, D, J false: K )
Unknown list is empty, returning
Result: ( true: A, C, D, J false: K )