Guest_imported
New member
- Jan 1, 1970
- 0
Below is the code which i am trying to get to work:
domains
sweet, ingredient = symbol.
predicates
is_type_of(sweet, sweet).
is_type_of(ingredient, ingredient).
is_ingredient_of(ingredient, sweet).
is_light(sweet).
clauses
is_type_of(chocolate, sweet).
is_type_of(hard, sweet).
is_type_of(chewy, sweet).
is_type_of(whipped,sweet).
is_type_of(candyfloss,sweet).
is_type_of(marzipan,sweet).
is_type_of(sucrose, sugar).
is_type_of(solid, chocolate).
is_type_of(covered_bars, chocolate).
is_type_of(fruit_drops, hard).
is_type_of(mints, hard).
is_type_of(rock, hard).
is_type_of(butterscotch, hard).
is_type_of(brittles, hard).
is_type_of(caramel, chewy).
is_type_of(toffee, chewy).
is_type_of(gum, chewy).
is_type_of(gelatine, gelling_agent).
is_type_of(fudge, whipped).
is_type_of(marshmallow, whipped).
is_type_of(gelatine, whipping_agents).
is_type_of(egg_white, whipping_agents).
is_type_of(X,Z) IF is_type_of(X,Y)
AND is_type_of(Y,Z).
is_ingredient_of(sugar, sweet).
is_ingredient_of(cacao_beans, chocolate).
is_ingredient_of(cacao_butter, chocolate).
is_ingredient_of(glucose_syrup, hard).
is_ingredient_of(water, hard).
is_ingredient_of(butter, butterscotch).
is_ingredient_of(butter, brittles).
is_ingredient_of(nuts, brittles).
is_ingredient_of(milk, caramel).
is_ingredient_of(milk, toffee).
is_ingredient_of(gelling_agent, gum).
is_ingredient_of(air, whipped).
is_ingredient_of(whipping_agents, marshmallow).
is_ingredient_of(ground_almonds, marzipan).
is_ingredient_of(X,Y) IF is_type_of(Y,Z)
AND is_ingredient_of(X,Z).
is_light(X) IF is_ingredient_of(air, X).
The rule:
is_ingredient_of(X,Y) IF is_type_of(Y,Z)
AND is_ingredient_of(X,Z).
is supposed to make sweets inherit facts which apply to the categorie they are in. I don't think i'm making much sense so i give an example.
air is an ingredient of whipped so the rule such also make air an ingredient of marshmallow as marshmallow is a type of whipped.
This works someways. If i query it by saying is_ingredient_of(air,X) then X = whipped, marshmallow, fudge but if i query it by saying is_ingredient_of(X,marshmallow) then air does not come up. This of course mucks up the rule: is_light(X) IF is_ingredient_of(air, X).
Please help me
Princess_Becks
domains
sweet, ingredient = symbol.
predicates
is_type_of(sweet, sweet).
is_type_of(ingredient, ingredient).
is_ingredient_of(ingredient, sweet).
is_light(sweet).
clauses
is_type_of(chocolate, sweet).
is_type_of(hard, sweet).
is_type_of(chewy, sweet).
is_type_of(whipped,sweet).
is_type_of(candyfloss,sweet).
is_type_of(marzipan,sweet).
is_type_of(sucrose, sugar).
is_type_of(solid, chocolate).
is_type_of(covered_bars, chocolate).
is_type_of(fruit_drops, hard).
is_type_of(mints, hard).
is_type_of(rock, hard).
is_type_of(butterscotch, hard).
is_type_of(brittles, hard).
is_type_of(caramel, chewy).
is_type_of(toffee, chewy).
is_type_of(gum, chewy).
is_type_of(gelatine, gelling_agent).
is_type_of(fudge, whipped).
is_type_of(marshmallow, whipped).
is_type_of(gelatine, whipping_agents).
is_type_of(egg_white, whipping_agents).
is_type_of(X,Z) IF is_type_of(X,Y)
AND is_type_of(Y,Z).
is_ingredient_of(sugar, sweet).
is_ingredient_of(cacao_beans, chocolate).
is_ingredient_of(cacao_butter, chocolate).
is_ingredient_of(glucose_syrup, hard).
is_ingredient_of(water, hard).
is_ingredient_of(butter, butterscotch).
is_ingredient_of(butter, brittles).
is_ingredient_of(nuts, brittles).
is_ingredient_of(milk, caramel).
is_ingredient_of(milk, toffee).
is_ingredient_of(gelling_agent, gum).
is_ingredient_of(air, whipped).
is_ingredient_of(whipping_agents, marshmallow).
is_ingredient_of(ground_almonds, marzipan).
is_ingredient_of(X,Y) IF is_type_of(Y,Z)
AND is_ingredient_of(X,Z).
is_light(X) IF is_ingredient_of(air, X).
The rule:
is_ingredient_of(X,Y) IF is_type_of(Y,Z)
AND is_ingredient_of(X,Z).
is supposed to make sweets inherit facts which apply to the categorie they are in. I don't think i'm making much sense so i give an example.
air is an ingredient of whipped so the rule such also make air an ingredient of marshmallow as marshmallow is a type of whipped.
This works someways. If i query it by saying is_ingredient_of(air,X) then X = whipped, marshmallow, fudge but if i query it by saying is_ingredient_of(X,marshmallow) then air does not come up. This of course mucks up the rule: is_light(X) IF is_ingredient_of(air, X).
Please help me
Princess_Becks