[[
✎ pl:prolog:pllib:model_bath_tub
]]
aiWiki
Pokaż stronę
Ostatnie zmiany
Indeks
Zaloguj
Ta strona jest tylko do odczytu. Możesz wyświetlić źródła tej strony ale nie możesz ich zmienić.
====== Model bath tub ====== {{tag>model}} ===== Description ===== A qualitative model of bath tub. **Source**: PROLOG programming for artificial intelligence, 3rd Edition, Harlow, 2001, ISBN 0-201-40375-7. ===== Download ===== Program source code: {{model_bath_tub.pl}} ===== Listing ===== <code prolog> % Figure 20.9 A qualitative model of bath tub. :- op( 900, fy, not). :- op( 220, xfy, ..). % not Goal): negation as failure; % Note: This is often available as a built-in predicate, % often written as prefix operator "\+", e.g. \+ likes(mary,snakes) not Goal :- Goal, !, fail ; true. % A bath tub model landmarks( amount, [ zero, full, inf]). landmarks( level, [ zero, top, inf]). landmarks( flow, [ minf, zero, inflow, inf]). correspond( amount:zero, level:zero). correspond( amount:full, level:top). legalstate( [ Level, Amount, Outflow, Netflow]) :- mplus( Amount, Level), mplus( Level, Outflow), Inflow = flow:inflow/std, % Constant in-flow sum( Outflow, Netflow, Inflow), % Netflow = Inflow - Outflow deriv( Amount, Netflow), not overflowing( Level). % Water not over the top overflowing( level:top..inf/_). % Over the top initial( [ level: zero/inc, amount: zero/inc, flow: zero/inc, flow: inflow/dec ] ). </code> ===== Comments =====
pl/prolog/pllib/model_bath_tub.txt
· ostatnio zmienione: 2019/06/27 15:50 (edycja zewnętrzna)
Pokaż stronę
Poprzednie wersje
Menadżer multimediów
Do góry