(1) You have declared three different types of possible emissions as facts.
(2) You have defined two "rules" for what was detected, but those rules have no way of knowing what emissions were observed. That is, there is no way to input the observed ray emissions to the rule.
Think about rewriting your rules to return the name of a sub-atomic particle when one or more emissions are detected.
Sometimes it's helpful to think in natural language: "If I detect emission 'X' and emission 'Y' then what kind of sub-atomic particle is associated with these emissions?" The emissions detected are the input and the particle type is the output.
I assume you are not ready to work with lists at this stage, so you might need to add an additional type of emission ('nil'). This way you can deal with single or two ray emissions without searching a list. So, you might have a clause like this:
particle_detect( proton, alpha, beta ):- !.
particle_detect( proton, gamma, nil ):- !.
particle_detect( proton, nil, gamma ):- !.
particle_detect( unknown, _, _ ).
This is not a formal solution, just a "thinking model" ... a "gedanken experiment", so to speak.
Code: Select all
detected(X) :- emission(alfa), emission(beta).
detected(X) :- emission(gama).
Sorry for my bad english.