RTPLAST-script

rfi-p> cd /home/vega/appl-kb/
rfi-p> cd "/home/vega/appl-kb/"
rfi-p> exec "rtp-sort.bat"

rfi-p> destroy-sortbase
rfi-p> destroy
rfi-p> style lisp
rfi-l> 
rfi-l> ;---------------------------------------------------------------------
rfi-l> ; A Declarative RELFUN Knowledge Base on Plastics Production/Recycling 
rfi-l> ;                             Partitioned 
rfi-l> ;  Into a Sort Base (Inheritance) and an Inference Base (Resolution)
rfi-l> ;---------------------------------------------------------------------
rfi-l> 
rfi-l> ;
rfi-l> ; (c) Harold Boley, Ulrich Buhrmann, Victoria Hall         20 Sept. 94
rfi-l> ;     Michael Herfert, Michael Sintek
rfi-l> ;
rfi-l> ; Sorts are regarded as unary predicates defined in a KB partition
rfi-l> ; and usable in relational queries and variable annotations
rfi-l> 
rfi-l> consult-sortbase rtplast-taxo-sub
; Reading file "/home/vega/appl-kb/rtplast-taxo-sub.rf" ..
rfi-l> compile-sortbase
rfi-l> browse-sortbase thermoplastic
rfi-l> sp
rfi-p> sortbase
subsumes(plastic, polykondensate).
subsumes(plastic, polymerisate).
subsumes(plastic, polyaddukte).
subsumes(plastic, thermoplastic).
subsumes(thermoplastic, pc).
subsumes(thermoplastic, pa).
subsumes(thermoplastic, lineare_polyester).
subsumes(thermoplastic, polyphenylene).
subsumes(polykondensate, pc).
subsumes(polykondensate, pa).
subsumes(polykondensate, lineare_polyester).
subsumes(polykondensate, polyphenylene).
subsumes(lineare_polyester, petb).
subsumes(lineare_polyester, pbtp).
subsumes(polyphenylene, ppo).
subsumes(thermoplastic, polyolefine).
subsumes(thermoplastic, vinylpolymere).
subsumes(thermoplastic, styrolpolymere).
subsumes(thermoplastic, polymethacrylester).
subsumes(thermoplastic, polyacetal).
subsumes(thermoplastic, flourkunststoffe).
subsumes(polymerisate, polyolefine).
subsumes(polymerisate, vinylpolymere).
subsumes(polymerisate, styrolpolymere).
subsumes(polymerisate, polymethacrylester).
subsumes(polymerisate, polyacetal).
subsumes(polymerisate, fluorkunststoffe).
subsumes(polyolefine, pe).
subsumes(polyolefine, pp).
subsumes(polyolefine, pib).
subsumes(polyolefine, pb).
subsumes(polyolefine, pmp).
subsumes(pp, hostalen).
subsumes(styrolpolymere, ps).
subsumes(styrolpolymere, sb).
subsumes(styrolpolymere, san).
subsumes(styrolpolymere, asa).
subsumes(styrolpolymere, abs-k).
subsumes(abs-k, novodur).
subsumes(fluorkunststoffe, ptfe).
subsumes(fluorkunststoffe, pctfe).
subsumes(fluorkunststoffe, pfep).
subsumes(fluorkunststoffe, pvf).
subsumes(fluorkunststoffe, pvdf).
subsumes(thermoplastic, pur).
subsumes(thermoplastic, chlorierter_polyaether).
subsumes(polyaddukte, pur).
subsumes(polyaddukte, chlorierter_polyaether).
subsumes(hostalen, hostalen-ppk-1).
subsumes(hostalen, hostalen-ppn-1).
subsumes(novodur, novodur-rec-1).
novodur-rec-1(novodur_r_5320).
novodur-rec-1(novodur_r_5322).
hostalen-ppk-1(hostalen_ppk_1060_f1).
hostalen-ppn-1(hostalen_ppn_1060).
hostalen-ppn-1(hostalen_ppn_1060_f).
hostalen-ppn-1(hostalen_ppn_1060_f1).
hostalen-ppn-1(hostalen_ppn_1060_f3).
hostalen-ppn-1(hostalen_ppn_2060).
hostalen-ppn-1(hostalen_ppn_4160).
subsumes(attribute, simple-attribute).
subsumes(attribute, numerical-attribute).
subsumes(numerical-attribute, simple-numerical-attribute).
subsumes(numerical-attribute, numerical-attribute-n/qmm-prototype).
subsumes(numerical-attribute-n/qmm-prototype, numerical-attribute-n/qmm).
subsumes(numerical-attribute, numerical-attribute-kj/qm-prototype).
subsumes(numerical-attribute-kj/qm-prototype, numerical-attribute-kj/qm).
subsumes(numerical-attribute, numerical-attribute-with-conditions).
subsumes(numerical-attribute-with-conditions, melting_index-prototype).
subsumes(melting_index-prototype, melting_index).
subsumes(numerical-attribute-with-conditions, volume_per_unit_time-prototype).
subsumes(volume_per_unit_time-prototype, volume_per_unit_time).
subsumes(attribute, interpol-attribute).
subsumes(interpol-attribute, simple-interpol-attribute).
subsumes(attribute, rule-attribute).
subsumes(rule-attribute, simple-rule-attribute-1).
subsumes(rule-attribute, simple-rule-attribute-2).
simple-attribute(identifier).
simple-attribute(cardinality).
simple-attribute(sort).
simple-attribute(method_for_test).
simple-attribute(additives).
simple-attribute(measurement).
simple-attribute(exists-with-conditions).
simple-attribute(recyclable).
simple-attribute(recycled).
simple-numerical-attribute(temperature).
simple-numerical-attribute(density).
simple-numerical-attribute(volume_per_unit_time_mvr_1_temperature).
simple-numerical-attribute(volume_per_unit_time_mvr_1_stress).
simple-numerical-attribute(volume_per_unit_time_mvr_2_temperature).
simple-numerical-attribute(volume_per_unit_time_mvr_2_stress).
simple-numerical-attribute(melting_index_mfi_1_temperature).
simple-numerical-attribute(melting_index_mfi_1_stress).
simple-numerical-attribute(melting_index_mfi_2_temperature).
simple-numerical-attribute(melting_index_mfi_2_stress).
simple-numerical-attribute(melting_index_mfi_3_temperature).
simple-numerical-attribute(melting_index_mfi_3_stress).
simple-numerical-attribute(vicat_a/50).
simple-numerical-attribute(vicat_b/50).
simple-numerical-attribute(yield_elangation).
simple-numerical-attribute(dimensional_stability_hdt/a).
simple-numerical-attribute(dimensional_stability_hdt/b).
numerical-attribute-n/qmm(yield_stress).
numerical-attribute-n/qmm(tension_module_of_elasticity).
numerical-attribute-n/qmm(tension_module_of_criep_1_h).
numerical-attribute-n/qmm(tension_module_of_criep_1000_h).
numerical-attribute-n/qmm(ball_thrust_hardness).
numerical-attribute-kj/qm(tension_notched-bar_impact_strength).
numerical-attribute-kj/qm(notched-bar_impact_strength).
numerical-attribute-kj/qm(izod-impact_strength_23).
numerical-attribute-kj/qm(izod-impact_strength_0).
numerical-attribute-kj/qm(izod-impact_strength_-30).
numerical-attribute-kj/qm(izod-notched-bar_impact_strength_23).
numerical-attribute-kj/qm(izod-notched-bar_impact_strength_0).
numerical-attribute-kj/qm(izod-notched-bar_impact_strength_-30).
melting_index(melting_index_mfi_1).
melting_index(melting_index_mfi_2).
melting_index(melting_index_mfi_3).
volume_per_unit_time(volume_per_unit_time_mvr_1).
volume_per_unit_time(volume_per_unit_time_mvr_2).
simple-interpol-attribute(stress-strain).
rfi-p> 
rfi-p> pause()

rfi-p> bye
true
rfi-p> 
rfi-p> % Load inference base
rfi-p> sl
rfi-l> consult rtplast-inf
; Reading file "/home/vega/appl-kb/rtplast-inf.rf" ..
rfi-l> sp
rfi-p> % Load some auxiliary predicates e.g. MEMBER
rfi-p> consult aux
% Reading file "/home/vega/appl-kb/aux.rfp" ..
rfi-p> 
rfi-p> % A function mapping materials and production processes to products
rfi-p> % Unary predicates are marked as sorts by a `$'-prefix
rfi-p> % listing used-for-rule
rfi-p> 
rfi-p> 
rfi-p> % Show all atributes of novodurs
rfi-p> listing  Attribute($novodur, V)
producer($novodur, bayer).
recyclable($novodur, horizontal-recycling).
izod-impact_strength_23($novodur-rec-1, 60).
izod-impact_strength_-30($novodur-rec-1, 40).
izod-notched-bar_impact_strength_23($novodur-rec-1, 12).
izod-notched-bar_impact_strength_-30($novodur-rec-1, 6).
ball_thrust_hardness($novodur-rec-1, 90).
recycling-product($novodur-rec-1, true).
yield_stress(novodur_r_5320, 38).
yield_elangation(novodur_r_5320, 2.1).
tension_module_of_elasticity(novodur_r_5320, 2000).
dimensional_stability_hdt/a(novodur_r_5320, 90).
dimensional_stability_hdt/b(novodur_r_5320, 95).
yield_stress(novodur_r_5322, 40).
yield_elangation(novodur_r_5322, 2.3).
tension_module_of_elasticity(novodur_r_5322, 2200).
dimensional_stability_hdt/a(novodur_r_5322, 96).
dimensional_stability_hdt/b(novodur_r_5322, 100).
rfi-p> 
rfi-p> pause()

rfi-p> bye
true
rfi-p> 
rfi-p> % Show additives of materials
rfi-p> listing additives(Material, V)
additives(hostalen_ppk_1060_f1, flameproofing_agent).
additives($hostalen-ppn-1, antistatic_additive).
rfi-p> 
rfi-p> pause()

rfi-p> bye
true
rfi-p> 
rfi-p> % A relation defining materials' E-module (tension module of elasticity)
rfi-p> listing tension_module_of_elasticity
tension_module_of_elasticity(hostalen_ppk_1060_f1, 1300).
tension_module_of_elasticity($hostalen-ppn-1, 1300).
tension_module_of_elasticity(novodur_r_5320, 2000).
tension_module_of_elasticity(novodur_r_5322, 2200).
rfi-p> pause()

rfi-p> bye
true
rfi-p> 
rfi-p> % For each novodur-rec-1, a subsort of novodur, find its
rfi-p> % tension_module_of_elasticity 
rfi-p> % Variable annotations are marked by a `:'-infix
rfi-p> tension_module_of_elasticity(Ident : $novodur-rec-1, E-module) 
true
Ident = novodur_r_5320
E-module = 2000
rfi-p> more
true
Ident = novodur_r_5322
E-module = 2200
rfi-p> more
unknown
rfi-p> 
rfi-p> 
rfi-p> listing ball_thrust_hardness
ball_thrust_hardness(hostalen_ppk_1060_f1, 67).
ball_thrust_hardness($hostalen-ppn-1, 68).
ball_thrust_hardness($novodur-rec-1, 90).
rfi-p> 
rfi-p> pause()

rfi-p> bye
true
rfi-p> 
rfi-p> % Use of sorted variables
rfi-p> 
rfi-p> 
rfi-p> % Find each novodur-rec-1 with its tension_module_of_elasticity
rfi-p> % and an unspecified ball_thrust_hardness
rfi-p> tension_module_of_elasticity(I : $novodur-rec-1, E-module),
ball_thrust_hardness(I, Bh)
true
I = novodur_r_5320
E-module = 2000
Bh = 90
rfi-p> more
true
I = novodur_r_5322
E-module = 2200
Bh = 90
rfi-p> more
unknown
rfi-p> 
rfi-p> pause()

rfi-p> bye
true
rfi-p> 
rfi-p> % Find each novodur-rec-1 with its tension_module_of_elasticity
rfi-p> % and a given ball_thrust_hardness of 90
rfi-p> 
rfi-p> tension_module_of_elasticity(I : $thermoplastic, E-module),
ball_thrust_hardness(I, 90)
true
I = novodur_r_5320
E-module = 2000
rfi-p> more
true
I = novodur_r_5322
E-module = 2200
rfi-p> more
unknown
rfi-p> 
rfi-p> 
rfi-p> % Let's find a material for producing electrical devices.
rfi-p> 
rfi-p> used-for(Material, Verarbeitungsform[elektrogeraete])
true
Material = hostalen_ppk_1060_f1
Verarbeitungsform = spritzgiessen
rfi-p> more
true
Material = hostalen_ppk_1060_f1
Verarbeitungsform = pressen
rfi-p> more
true
Material = $hostalen-ppn-1
Verarbeitungsform = pressen
rfi-p> 
rfi-p> pause()

rfi-p> bye
true
rfi-p> 
rfi-p> % A function computing the recyclability of materials
rfi-p> listing horizontal-recycling
horizontal-recycling(Plastic-id) :- 
         additives(Plastic-id : $pp, flameproofing_agent) &
         only_in_closed_circle.
horizontal-recycling(Plastic-id) :- 
         additives(Plastic-id : $pp, Additives),
         naf(Additives is flameproofing_agent) &
         possible.
horizontal-recycling(Plastic-id) :- 
         additives(Plastic-id : $abs-k, flameproofing_agent) &
         only_in_closed_circle.
horizontal-recycling(Plastic-id) :- 
         additives(Plastic-id : $abs-k, Additives),
         naf(Additives is flameproofing_agent) &
         possible.
rfi-p> pause()

rfi-p> bye
true
rfi-p> 
rfi-p> 
rfi-p> % Now let's find a recyclable electrical device
rfi-p> 
rfi-p> used-for(Material, Verarbeitungsform[elektrogeraete]),
recyclable(Material,Rule), Rule(Material)  
only_in_closed_circle
Material = hostalen_ppk_1060_f1
Verarbeitungsform = spritzgiessen
Rule = horizontal-recycling
rfi-p> more
only_in_closed_circle
Material = hostalen_ppk_1060_f1
Verarbeitungsform = pressen
Rule = horizontal-recycling
rfi-p> more
possible
Verarbeitungsform = pressen
Rule = horizontal-recycling
Material = $hostalen-ppn-1
rfi-p> 
rfi-p> 
rfi-p> pause()

rfi-p> bye
true
rfi-p> 
rfi-p> % `Terminological' knowledge about the attributes themselves
rfi-p> listing Att(ball_thrust_hardness, Value)
cardinality($numerical-attribute, <=[1]).
sort($numerical-attribute, real).
measurement($numerical-attribute-n/qmm-prototype, /[n, ^[mm, 2]]).
method_for_test(ball_thrust_hardness, [din_53456]).
rfi-p> cardinality(ball_thrust_hardness, Fun[Val]), Fun(Val,1)
true
Fun = <=
Val = 1
rfi-p> 
rfi-p> 
rfi-p> bye
Harold Boley & Franz Schmalhofer | schmalho@dfki.uni-kl.de