.

Разработка диалоговой системы, оформленной в виде пакета прикладных программ и реализующей идею искусственного интеллекта (WinWord, PASCAL)

Язык: русский
Формат: реферат
Тип документа: Word Doc
0 906
Скачать документ

1.Caaeaiea ia eaai?aoi?ioth ?aaioo

?ac?aaioaoue aeeaeiaiaoth nenoaio, ioi?ieaiioth a aeaea iaeaoa i?eeeaaeiuo i?ia?aii e ?aaeecothuoth eaeath eneonnoaaiiiai eioaeeaeoa. Aeey yoiai iaiaoiaeeii:
* Naiinoiyoaeueii aua?aoue i?aaeiaoioth iaeanoue eioaeeaeooaeueiiai iaeaoa
* Aeey aua?aiiie i?aaeiaoiie iaeanoe iienaoue naiaioe/aneoth naoue e i?aaeea auaiaea (aaco ciaiee)
* ?ac?aaioaoue aeiee nenoaiiie /anoe iaeaoa, ?aaeecothuea:
* iaoeio eiae/aneiai auaiaea
* i?ioeaaeo?u ?aaiou n naiaioe/aneie naoueth
* Iiaeaioiaeoue ioeaaei/iua aa?eaiou iaai?ia aeaiiuo
* I?iaanoe iaoeiiue yenia?eiaio
* Iienaoue iieo/aiiua ?acoeueoaou
2.?oeiaiaenoai iieueciaaoaey

2.1. Iacia/aiea i?ia?aiiu
A ea/anoaa i?aaeiaoiie iaeanoe auea aua?aia eoeeia?ey.
I?ia?aiia i?aaeiacia/aia aeey iieo/aiey eioi?iaoeee i ninoaaa ?acee/iuo eoeeia?iuo aethae. Iieueciaaoaeth i?aaeinoaaeyaony aiciiaeiinoue ia?a/eneeoue ianeieueei eia?aaeeaioia e iieo/eoue eioi?iaoeeth i oii, /oi ec yoiai iaai?a iiaeii i?eaioiaeoue, eee aaanoe eioa?anothuaa aethaei e ociaoue ec /aai iii ninoieo, eee aaanoe eae eia?aaeeaiou oae e aioiaue i?iaeoeo e ociaoue aeinoaoi/ii ee aaaaeaiiuo eiiiiiaio aeey i?eaioiaeaiey aua?aiiiai aethaea.
I?ia?aiia iicaieyao ei??aeoe?iaaoue eiathuothny aaco ciaiee e nicaeaaaoue iiaoth. Ei??aeoe?iaea caeeth/aaony a aeiaaaeaiee e oaeaeaiee ciaiee e oaeoia. Ii a oeaeyo niaethaeaiey oeaeinoiinoe aacu ciaiee i?ia?aiia ia iicaieeo oaeaeeoue iaeioi?ua ciaiey e oaeou. Anee oaeo aoiaeeo a ninoaa ciaiey, oi aai oaeaeaiea iiaea/ao ia?ooaiea oeaeinoiinoe aacu. I?ia?aiia i?aaeeiaeeo nia/aea oaeaeeoue ciaiey, a eioi?ua aoiaeeo yoio oaeo, a iioii oaea nai oaeo.

2.2.Iienaiea aacu ciaiee

Aaca ciaieeOaeou (aeaeea?aoeaiua ciaiey)I?aaeea (i?ioeaaeo?iua ciaiey)

Aeaeea?aoeaiua ciaiey
*eneiaie eiaeCia/aiea12 yeoea23 yeoea34 yeoea4100 a?aii iieiea5200 a?aii iieiea6400 a?aii iieiea70,5 eiaeee niee81 eiaeea niee92 eiaeee niee101 noaeai ioee112 noaeaia ioee124 noaeaia ioee1310 eiaeae naoa?a1413 eiaeae naoa?a1515 eiaeae naoa?a16Ecthi17Aei?iaeaee18Oai?ia19Iieao ia 1-ai /aeiaaea20Iieao ia 2-o /aeiaae21Iia?a22Oanoi23Aeeiu24sse/ieoea ia 1-ai /aeiaaea25sse/ieoea ia 2-o /aeiaae26Eoee/27Aao?ooea28AEa?eoue29Ia/ue

I?ioeaaeo?iua ciaiey
Eiae ii?iaeaeaaiiai oaeoaEiee/anoai
naeaeaoaeuenoaNaeaeaoaeuenoaa1941,4,7,282043,5,8,282145,9,11,1722521,3,4,12,1523222,282431,7,282533,8,2826322,16,2927322,18,29

2.3. Iienaiea aeeaeiaa
Aeaiiay i?ia?aiia iino?iaia ii i?eioeeio aeeaeiaa n iieueciaaoaeai, /oi iaania/eaaao oaeianoai e ineoieiae/aneee eiioi?o i?e ?aaioa n iae.
Iinea caionea i?ia?aiiu iiyaeyaony noaiaea?oiia windows-ieii – a aeaiiii neo/aa aeaaiia ieii, i?eaeaoathuaa aan e ?aaioa. Aeaiiia ieii niaea?aeeo ea?oeieo, ?aniieaaathuoth aan e i?eyoiie ?aaeecaoeee i?ia?aiiiiai i?iaeoeoa, e iaith ec o?ao ioieoia: Aeaaiia iaith, niaea?aeauaa iiaeioieou: ?aaioa n nenoaiie e Auoiae, “Iiiiuue” e I i?ia?aiia. Aua?aa ?aaioa n nenoaiie, au ia oieueei ociaaoa i aa iacaaiee e aa?nee, ii e i nicaeaoaeyo oaeiaie. Auai? iiaeii inouanoaeyoue e?iia iuoe n iiiiuueth ni/aoaiey eeaaeo (Alt + niioaaonoaothuay aoeaa). Iaaeaa iaith ?aaioa n nenoaiie, au ieaaeeoanue a ieia CulinaryMiracles aaea aai aoaeao i?aaenoaaeaiu neaaeothuea aiciiaeiinoe nenoaiu: I?aaea, ?aaioa, Auoiae. Iciaeiieaoenue n ioieoii Iiiiuue, a eioi?ii niaea?aeeony iauay eioi?iaoeey ii aeaiiiio i?ia?aiiiiio i?iaeoeoo, au niaei iiaeaoa i?enooiaoue e ?aaeecaoeee iniiaiuo aeaenoaee.
I?e auai?a ?aaioa n nenoaiie iiyaeony ?aai/aa ieii, aaea aai aoaeao i?aaeeiaeaiu eiathueany oaeou e oeaee enoiaeiie aacu ciaiee. Oaia?ue ana a aaoeo ?oeao. Aeaiiay i?ia?aiia i?aaeinoaaeyao o?e aa?eaioa ?aaeecaoeee aa aiciiaeiinoae. Ai-ia?auo, au iiaeaoa aua?aoue eioa?anothuea aan oaeou e ni?ineoue o nenoaiu, /oi iiaeii ec ieo i?eaioiaeoue, ai-aoi?uo, aua?aoue aeaeaaiua oeaee e cai?ineoue, eaeea oaeou iaiaoiaeeiu aeey eo ?aaeecaoeee, e iaeiiaoe a-o?aoueeo, aua?aoue e oaeou e oeaee, a caoai nenoaia auaeano niiauaiea i oii, /oi ana a ii?yaeea eeai iiaeneaaeao aai eaeea ec aua?aiiuo oaeoia ieacaeenue eeoieie, a eaeeo ia oaaoaao. Auoa ia?a/eneaiiua aeaenoaey ?aaeecothony eaaei e i?inoi n iiiiuueth eiiiie: aeiaaaeoue oaeo/oeaeue a nienie aua?aiiuo oaeoia/oeaeae – “(“, oaeaeeoue oaeo/oeaeue ec nienea aua?aiiuo oaeoia/oeaeae – “(” e caione ia auiieiaiea “OK”. Aeey auiieiaiey iineaaeothueo cai?inia aai iaiaoiaeeii iaaeaoue eiiieo “Na?in”.
Aeey iiaea?iecaoeee aiciiaeiinoae “Culinary Miracles” ainiieuecoeoanue ioieoii I?aaea, aaea aai aoaeoo i?aaenoaaeaiu oaeou, niaaaeaiiua eioi?iaoeeae, oi anoue, i?inoie ee yoi oaeo eee ii?iaeaeaaiue oaeo n niaea?aeaueieny a iai naeaeaoaeuenoaaie. A aeaiiii ioieoa iaith au iiaeaoa ia oieueei aeiaaaeoue eee oaeaeeoue oaeou enoiaeiie aacu ciaiee, ii e nio?aieoue eciaiaiioth (iiaoth) aaco a oaee, a oaeaea ioe?uoue ethaoth ec i?aaeeiaeaiiuo.
Ana eiiiiiaiou i?ia?aiiu niaaaeaiu iiiiuueth, iiaeneaceaie, /oi iaeaa/aao ?aaioo iieueciaaoaey, eae-oi: niiauaiey i aeiiouaiiuo ioeaeao, cai?in nenoaiu i oii, aeaenoaeoaeueii ee au oioeoa niaa?oeoue oi eee eiia aeaenoaea e o.ae. Ieii/ea ?aaioo, au iieeaeaaoa nenoaio n iiiiuueth ioieoa Auoiae eee ae?oaeie noaiaea?oiuie niiniaaie Windows.

2.4. Iienaiea ?aaioa iaoeiiiai eiae/aneiai auaiaea

2.4.1. Iienaiea no?aoaaee

No?aoaaey ?aaeecaoeee iinoaaeaiiie caaea/e ?acaeoa ia 3 aiciiaeiuo aa?eaioa aeaeaiee iieueciaaoaey. Ana caaeneo io oiai, /oi iieueciaaoaeue aaaaeao: oieueei oaeou (eiiiiiaiou), oieueei ciaiey (aethaea), e oaeou e ciaiey. Nenoaia naia ?aniiciaao, eaeie aa?eaio aaaaeai e iieaeao ii ioaeiiio iooe.
Neo/ae 1. Aaaaeaiu oieueei oaeou. A aeaiiii neo/aa nenoaia caaeaenoaoao aeai?eoi ieaie?iaaiey n i?yiui oiaeii. Anee oioue iaeei oeaeaaie oaeo (o.a. nuaaeiaiia aethaei) aeinoeaeei, oi i?ia?aiia iieaaeao, /oi eiaiii. ?acoeueoaoii iiaeao noaoue oieueei iaeii aethaei. O.a. ia iaeiathuaa niunea ia?a/eneaiea anao eia?aaeeaioia, i?ia?aiia ne?iiii auaeano oieueei iaeii aethaei.
Neo/ae 2. Aaaaeaiu oieueei ciaiey. A yoii neo/aa i?ia?aiia caaeaenoaoao aeai?eoi ieaie?iaaiey n ia?aoiui oiaeii. Iiaeii aaanoe eae iaeii, oae e ianeieueei aethae, e i?ia?aiia auaeano ana eia?aaeeaiou aeey eioa?anothueo ciaiee.
Neo/ae 3. Aaaaeaiu e oaeou e ciaiey. A yoii neo/aa nenoaia aiaeece?oao, /oi iaiaoiaeeii aeey aaaaeaiuo ciaiee, iioii eaeea iaiaoiaeeiua oaeou aaae iieueciaaoaeue e a caeeth/aiee niiauaao eaeea oaeou eeoiea, a eaeeo iaaeinoaao.

2.4.2. I?yiia ieaie?iaaiea

Iiaeaioiaea: iaioeaiea ?acee/iuo eeth/ae e n/ao/eeia.
Oeeee ia i?aaiecaoeeth ia?aaioee aacu ciaiee aei oao ii?, iiea ia aoaeao iieo/aii ia?aia oeaeaaia cia/aiea eee ia noaiao ynia iaaiciiaeiinoue aai iieo/aiey.
Oeeee ia i?iniio? anao i?aaee aei ii?iaeaeaiey oeaeaaiai oaeoa.
.Aioo?e yoiai oeeeea inouanoaeyaony i?iaa?ea ia iaiaoiaeeiinoue ii?iaeaeaiey i?aaeea e aiciiaeiinoue ii?iaeaeaiey i?aaeea. Anee e oi e oi iiaeoaa?aeaeaaony, oi ii?iaeaeaaony oaeo (i?aaeei), e anee yoio oaeo oeaeaaie, oi ia?aaioea caeai/eaaaony e yoio oaeo caiiieiaaony, eia/a ia?aoiae e neaaeothuaio i?aaeeo.
. Eiiaoe oeeeea.
Eiiaoe aeai?eoia, anee aue ii?iaeaeai oeaeaaie oaeo, oi auaea/a ?acoeueoaoa ia ye?ai, eia/a auaea/a niiauaiey i iaaiciiaeiinoe i?eaioiaeaiey ie iaeiiai aethaea ec i?aaeeiaeaiiuo eiiiiiaioia.

Aeai?eoi i?yiiai ieaie?iaaiey ?aaeeciaai a i?ioeaaeo?a Direct.

2.4.3. Ia?aoiia ieaie?iaaiea

Iiaeaioiaea: iaioeaiea ?acee/iuo eeth/ae e n/ao/eeia.
Oeeee ia i?iniio? anao aaaaeaiiuo iieueciaaoaeai i?aaee. Caianaiea yoiai cia/aiey a niaoeeaeueiue iannea.
Oeeee ia ?aceiaeaiea eaaeaeiai aaaaeaiiiai iieueciaaoaeai i?aaeea ia i?inoua eiiiiiaiou. Ana eiiiiiaiou (oaeou e ciaiey) caiinyony a niaoeeaeueiue iannea, eioi?ue aiaeece?oaony ia iaee/ea a iai i?aaee. Anee i?aaeei iaeaeaii, oi aai ?aceaaatho ia aieaa i?inoua ninoaaeythuea, e oae oi oao ii?, iiea io aaaaeaiiiai i?aaeea inoaioony oieueei i?inoua oaeou.
Eiiaoe oeeeea. Ia?aoiae e neaaeothuaio aaaaeaiiiio i?aaeeo.
Eiiaoe aeai?eoia. Auaea/a ?acoeueoaoia ia ye?ai.

Aeai?eoi i?yiiai ieaie?iaaiey ?aaeeciaai a i?ioeaaeo?a Inv.

2.5.I?eia?u ?aaeecaoeee iniiaiuo ooieoeee iieueciaaoaey

Caaeaiea oaeoia e iieo/aiea oeaee

Caaeaiea oeaeae e iieo/aiea oaeoia

Caaeaiea oaeoia e oeaeae e iieo/aiea eioi?iaoeee i eeoieo e iaaeinoathueo oaeoao

Caaeaiea oaeoia e oeaeae e iieo/aiea iieiaeeoaeueiiai niiauaiey nenoaiu

Aeiaaaeaiea oaeoa a aaco

3.Iienaiea i?ia?aiiu

3.1. Iauea naienoaa
Ethaay i?ia?aiia a eioaa?e?iaaiiie n?aaea ?ac?aaioee i?eeiaeaiee Delphi 4 ninoieo ec oaeea i?iaeoa (oaee n ?anoe?aieai dpr) e ianeieueeeo iiaeoeae (oaeeu n ?anoe?aieai pas), eaaeaeue ec eioi?uo iienuaaao i?ia?aiiioth aaeeieoeo Object Pascal. Oaee i?iaeo i?aaenoaaeyao niaie i?ia?aiio, iaienaiioth ia ycuea Object Pascal e i?aaeiacia/aiioth aeey ia?aaioee eiiieeyoi?ii. Yoa i?ia?aiia aaoiiaoe/anee nicaeaaony Delphi, niaea?aeeo eeoue ianeieueei no?ie e ia i?aaeiacia/aia aeey ?aaeaeoe?iaaiey.
Aeaiiay i?ia?aiia iaienaia n iiiiuueth eino?oiaioa i?ia?aiie?iaaiey Delphi 4 e ninoieo ec oaeea i?iaeoa CulinaryMiraclese o?ao iiaeoeae: Culinary.pas, About.pas, Help.pas.

3.2. Eiae/aneay no?oeoo?a i?ia?aiiu
Oae eae ycue i?ia?aiie?iaaiey Object Pascal – yoi iauaeoii-i?eaioe?iaaiiue ycue, oi ioia?aceoue noaiaoe/ii iiiaiia?acea i?ioeaaeo? – ia?aaio/eeia niauoee iaaeaoee ia iiiai/eneaiiua eiiiee, auciaia iaith e i?i/aa ia iicaieyao eeno aoiaae. Oae /oi eiae/aneay no?oeoo?a ioia?aaeaao oieueei iiaeoee ?aaiou nenoaiu ii ia?aaioea aaaaeaiiuo aeaiiuo, aeiaaaeaieth e oaeaeaieth oaeoia, nio?aiaieth e ioe?uoeth aacu ciaiee.

3.3.Iienaiea ooieoeee iiaeoeae

1procedure FormActivate Caaeaiea ia/aeueiuo ia?aiao?ia, caa?ocea aacu ciaiee Base.dat2.
2procedure Timer1Timer Iaania/eaaao aaaouea iaaeiene i?e canoaaea3. 3procedure N6ClickIa?aaio/ee auciaa iaith I i?ia?aiia4.
4procedure N2ClickIa?aaio/ee auciaa iaith ?aaioa n nenoaiie5.
5Procedure SpeedButton3ClickIa?aaio/ee iaaeaoey eiiiee Auoiae, auoiae ec i?ia?aiiu6.
6Procedure SpeedButton1ClickIa?aaio/ee iaaeaoey eiiiee I?aaea7.
7Procedure SpeedButton8ClickIa?aaio/ee iaaeaoey eiiiee Aica?ao, aica?ao a aeaaiia iaith8.
Procedure SpeedButton2ClickIa?aaio/ee iaaeaoey eiiiee ?aaioa, iiyaeaiey ieia aeey auai?a oaeoia e ciaiee9.
procedure N7ClickIa?aaio/ee auciaa ioieoa Aica?ao a ieia auai?a oaeoia
procedure BitBtn1ClickCaianaiea oaeoia a ieioei “Aua?aiiua oaeou”11.
Procedure BitBtn3ClickCaianaiea oaeoia a ieioei “Aua?aiiua oeaee”12.
Procedure BitBtn5ClickIa?aaio/ee iaaeaoey eiiiee IE, ia?aaioea aaaaeaiuo aeaiiuo, auaea/a ?aceueoaoia13.
Procedure BitBtn6ClickIa?aaio/ee iaaeaoey eiiiee Na?in, iaioeaiea n/ao/eeia14. Procedure Timer2TimerIaania/eaaao auieuaaiea iaaeiene IE!15.
Procedure LoadBaseI?ioeaaeo?a ioe?uoey iiaie aacu16.
procedure SaveBaseI?ioeaaeo?a nio?aiaiey oaeouae aacu17.
Procedure SpeedButton6ClickIa?aaio/ee iaaeaoey eiiiee Ioe?uoue AC, auaea/a niioaaonoaothuaai aeeaeiaiaiai ieia18.
Procedure SpeedButton7ClickIa?aaio/ee iaaeaoey eiiiee Nio?aieoue eae, auaea/a niioaaonoaothuaai aeeaeiaiaiai ieia19.
procedure ListBox1ClickIoia?aaeaiea oaeoia a ieia “Eiathueany oaeou”20.
Procedure SpeedButton4Click Ia?aaio/ee iaaeaoey eiiiee Aeiaaaeoue, ioia?aaeaiea ieioea aeey aeiaaaeaiey a AC oaeoia21.
Procedure SpeedButton10ClickIa?aaio/ee iaaeaoey eiiiee Ioiaia a ieioea aeey aeiaaaeaiey oaeoia, aica?ao a ieii I?aaea22.
Procedure RadioGroup1ClickIa?aaio/ee auai?a oeia oaeoa a ieia aeiaaaeaiey oaeoia23.
procedure AddSimpleFactI?ioeaaeo?a aeiaaaeaiey i?inoiai oaeoa24.
Procedure SpeedButton9ClickIa?aaio/ee iaaeaoey eiiiee IE a ieioea aeey aeiaaaeaiey oaeoia, aucia i?ioeaaeo?u AddSimpleFact25.
Procedure SpeedButton11ClickIa?aaio/ee iaaeaoey eiiiee Aeiaaaeoue i?e aeiaaaeaiee oaeoia a AC, yoa eiiiea aeiaaaeyao oaeou a ciaiea i?e aai ii?aaeaeaiee26. Procedure AddComplexFactI?ioeaaeo?a aeiaaaeaiey i?aaeea27.
procedure DeleteFactI?ioeaaeo?a oaeaeaiey oaeoa28.
Procedure SpeedButton5ClickIa?aaio/ee iaaeaoey eiiiee Oaeaeeoue29.
Procedure BitBtn2ClickOaeaeaiea oaeoia a ieia “Aua?aiiua oaeou”30.
procedure BitBtn4ClickOaeaeaiea oaeoia a ieia “Aua?aiiua oeaee”31.
procedure N5ClickAucia ioieoa iaith Iiiiuue, iiyaeaiea ieia Iiiiuue32.
procedure N4ClickAucia ioieoa iaith Auoiae, auoiae ec i?ia?aiiu

4.Nienie eeoa?aoo?u

1. A.A.Aeaaiaeaoneeo, N.I.Naiaiia, A.I.Oaiia. Eaai?aoi?iue i?aeoeeoi ii i?eeeaaeiiio e nenoaiiiio i?ia?aiie?iaaieth.- I.: Oeiainu e noaoenoeea, 1985.
2. Oa?iiia A.A. Delphi4,o/aaiue eo?n. – I.: “Iieeaeae”,1999.
3. A.A. Aeaaiaeaoneeo, I.A. Aiaeaa?yi, A.A. Eiaaeaaneay. Yeiiiieea, ?ac?aaioea e eniieueciaaiea i?ia?aiiiiai iaania/aiey YAI. – I.:Oeiainu e noaoenoeea, 1995.
4. ?ia Aaan, Iaee Oa?aae. Delphi 4 Iieiia ?oeiaiaenoai – Eeaa, ecaeaoaeueneay a?oiia BHV, 1999.

5.I?eeiaeaiey

5.1.Eenoeiae i?ia?aiiu

unit Culinary;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, jpeg, Menus, Buttons;

type
TForm1 = class(TForm)
Image1: TImage;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Timer1: TTimer;
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
ListBox1: TListBox;
ListBox2: TListBox;
Label4: TLabel;
Label5: TLabel;
Bevel1: TBevel;
Bevel2: TBevel;
SpeedButton4: TSpeedButton;
SpeedButton5: TSpeedButton;
SpeedButton6: TSpeedButton;
SpeedButton7: TSpeedButton;
SpeedButton8: TSpeedButton;
Bevel3: TBevel;
ListBox4: TListBox;
ListBox5: TListBox;
ListBox6: TListBox;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Bevel4: TBevel;
Bevel5: TBevel;
N7: TMenuItem;
BitBtn5: TBitBtn;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
Label11: TLabel;
Label12: TLabel;
BitBtn6: TBitBtn;
Label13: TLabel;
Timer2: TTimer;
ListBox3: TListBox;
OpenDialog1: TOpenDialog;
SaveDialog1: TSaveDialog;
Bevel6: TBevel;
Bevel7: TBevel;
Label6: TLabel;
ComboBox3: TComboBox;
Edit1: TEdit;
RadioGroup1: TRadioGroup;
Panel1: TPanel;
SpeedButton9: TSpeedButton;
SpeedButton10: TSpeedButton;
Label14: TLabel;
Label15: TLabel;
SpeedButton11: TSpeedButton;
procedure FormActivate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure N6Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton8Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure N7Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn5Click(Sender: TObject);
procedure BitBtn6Click(Sender: TObject);
procedure Timer2Timer(Sender: TObject);
procedure LoadBase;
procedure SaveBase;
procedure SpeedButton6Click(Sender: TObject);
procedure SpeedButton7Click(Sender: TObject);
procedure ListBox1Click(Sender: TObject);
procedure SpeedButton4Click(Sender: TObject);
procedure SpeedButton10Click(Sender: TObject);
procedure RadioGroup1Click(Sender: TObject);
procedure AddSimpleFact;
procedure SpeedButton9Click(Sender: TObject);
procedure SpeedButton11Click(Sender: TObject);
procedure AddComplexFact;
procedure DeleteFact;
procedure SpeedButton5Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn4Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure N4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
TFactFile = record {oaeo}
Number:integer; {iiia? oaeoa}
Znach:string[40]; {cia/aiea oaeoa}
Q:integer; {eiee/anoai ii?iaeaeaaiuo oaeoia}
FactIn:array[1..10] of integer; {iannea ii?iaeaeaaiuo oaeoia}
Zel:byte;{Oeaeaaie eee iaoeaeaaie oaeo}
end;

TKnow = Record {ii?iaeaeaaiue oaeo}
Number:integer; {iiia? ii?iaeaeaaiiai oaeoa}
Q:integer; {eiee/anoai ii?iaeaeaaiuo oaeoia}
FactIn:array[1..10] of integer; {iannea ii?iaeaeaaiuo oaeoia}
Zel:byte;
end;

TFact= record {oaeo}
Number:integer; {iiia? oaeoa}
Znach:string[40]; {cia/aiea oaeoa}
end;
TBase=Record
Fact:array[1..40] of integer;
Rule:array [1..40] of TKnow;
end;

TFF=file of TFactFile;
var
Form1: TForm1;
FF:TFF;
TermFact:array[1..50] of integer; {iannea c oai /oi oioei eiaoue ia auoiaea}
NE,NK,NF,NF1,NFF,NR,KEND,Rez,NST,Num:integer;
Spis:array[1..30] of integer; {iaiaoiaeeiua oaeou aeey oeaee}
SpisF:array[1..30] of integer; {aua?aiiua oaeou}
BaseKnow:TBase;

Knowledge:array[1..5] of integer; {iannea n aua?aiiuie i?aaeeaie}
VectFact:array[1..50] of TFact; {aaca oaeoia}
implementation

uses About, Help;

{$R *.DFM}

procedure TForm1.FormActivate(Sender: TObject);
var
Know:TKnow;
Fact:TFact; FactFile:TFactFile;
i,j:integer;
begin
NF:=0;NF1:=0;NK:=0;
AssignFile(FF,’Base.dat’); {Oaee n oaeoaie}
Reset(FF);
NFF:=0;
While Not eof(FF) do
begin
Read(FF,FactFile);
NFF:=NFF+1;
VectFact[NFF].Number:=FactFile.Number;
VectFact[NFF].Znach:=FactFile.Znach;
ListBox1.Items.Add(VectFact[NFF].Znach);
ListBox3.Items.Add(VectFact[NFF].Znach);
if FactFile.Q>1 then
begin
NR:=NR+1;
BaseKnow.Rule[NR].Number:=FactFile.Number;
BaseKnow.Rule[NR].Zel:=FactFile.Zel;
ListBox5.Items.Add(FactFile.Znach);
BaseKnow.Rule[NR].Q:=FactFile.Q;
for i:=1 to BaseKnow.Rule[NR].Q do
BaseKnow.Rule[NR].FactIn[i]:=FactFile.FactIn[i];
end;
end;
closefile(FF);

end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
label1.top:=label1.top-2;
label2.left:=label2.left+4;
label3.top:=label3.top+2;
if label2.left=100 then
timer1.Enabled:=false;
end;

procedure TForm1.N6Click(Sender: TObject);
begin
AboutBox.Show;
end;

procedure TForm1.N2Click(Sender: TObject);
begin
N1.Visible:=false;
N2.Visible:=false;
N3.Visible:=false;
N4.Visible:=false;
{N5.Visible:=false;
N6.Visible:=false;}
label1.Visible:=false;
label2.Visible:=false;
label3.Visible:=false;
form1.Height:=150;
form1.Width:=185;
form1.BorderStyle:=bsDialog;
form1.Position:=poScreenCenter;
speedbutton1.Visible:=true;
speedbutton2.Visible:=true;
speedbutton3.Visible:=true;
end;

procedure TForm1.SpeedButton3Click(Sender: TObject);
begin
close;
end;

procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
form1.Height:=343;
form1.Width:=450;
form1.BorderStyle:=bsSingle;
form1.Position:=poScreenCenter;
speedbutton1.Visible:=false;
speedbutton2.Visible:=false;
speedbutton3.Visible:=false;
speedbutton4.Visible:=true;
speedbutton5.Visible:=true;
speedbutton6.Visible:=true;
speedbutton7.Visible:=true;
speedbutton8.Visible:=true;
listbox1.Visible:=true;
listbox2.Visible:=true;
bevel1.Visible:=true;
bevel2.Visible:=true;
bevel3.Visible:=true;
bevel3.Width:=430;
label4.Visible:=true;
label5.Visible:=true;
label6.Visible:=true;
end;

procedure TForm1.SpeedButton8Click(Sender: TObject);
begin
form1.Height:=150;
form1.Width:=185;
form1.BorderStyle:=bsDialog;
form1.Position:=poScreenCenter;
speedbutton1.Visible:=true;
speedbutton2.Visible:=true;
speedbutton3.Visible:=true;
speedbutton5.Visible:=false;
speedbutton6.Visible:=false;
speedbutton7.Visible:=false;
speedbutton8.Visible:=false;
listbox1.Visible:=false;
listbox2.Visible:=false;
bevel1.Visible:=false;
bevel2.Visible:=false;
bevel3.Visible:=false;
bevel3.Width:=481;
label4.Visible:=false;
label5.Visible:=false;
label6.Visible:=false;
panel1.Visible:=false;
edit1.Visible:=false;
combobox3.Visible:=false;
radiogroup1.Visible:=false;
speedbutton11.visible:=false;
end;

procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
form1.Height:=343;
form1.Width:=503;
form1.BorderStyle:=bsSingle;
form1.Position:=poScreenCenter;
speedbutton1.Visible:=false;
speedbutton2.Visible:=false;
speedbutton3.Visible:=false;
BitBtn5.Visible:=true;
BitBtn6.Visible:=true;
bevel3.Visible:=true;
bevel4.Visible:=true;
bevel5.Visible:=true;
bevel6.Visible:=true;
bevel7.Visible:=true;
ListBox3.Visible:=true;
ListBox4.Visible:=true;
ListBox5.Visible:=true;
ListBox6.Visible:=true;
label7.Visible:=true;
label8.Visible:=true;
label9.Visible:=true;
label10.Visible:=true;
label11.Visible:=true;
label12.Visible:=true;
ComboBox1.Visible:=true;
ComboBox2.Visible:=true;
BitBtn1.Visible:=true;
BitBtn2.Visible:=true;
BitBtn3.Visible:=true;
BitBtn4.Visible:=true;
N7.Visible:=true;
end;

procedure TForm1.N7Click(Sender: TObject);
begin
form1.Height:=150;
form1.Width:=185;
form1.BorderStyle:=bsDialog;
form1.Position:=poScreenCenter;
speedbutton1.Visible:=true;
speedbutton2.Visible:=true;
speedbutton3.Visible:=true;
BitBtn5.Visible:=false;
BitBtn6.Visible:=false;
bevel3.Visible:=false;
bevel4.Visible:=false;
bevel5.Visible:=false;
bevel6.Visible:=false;
bevel7.Visible:=false;
ListBox3.Visible:=false;
ListBox4.Visible:=false;
ListBox5.Visible:=false;
ListBox6.Visible:=false;
label7.Visible:=false;
label8.Visible:=false;
label9.Visible:=false;
label10.Visible:=false;
BitBtn1.Visible:=false;
BitBtn2.Visible:=false;
BitBtn3.Visible:=false;
BitBtn4.Visible:=false;
N7.Visible:=false;
label11.Visible:=false;
label12.Visible:=false;
ComboBox1.Visible:=false;
ComboBox2.Visible:=false;
BitBtn6Click(Sender);
end;

procedure TForm1.BitBtn1Click(Sender: TObject);
var
rab:integer;
begin
rab:=ListBox3.itemindex;
listbox4.Items.Add(VectFact[rab+1].Znach);
NF1:=NF1+1;
SpisF[NF1]:=VectFact[rab+1].Number;
BaseKnow.Fact[NF1]:=VectFact[rab+1].Number;
NF:=NF1;
end;

procedure TForm1.BitBtn3Click(Sender: TObject);
var rab,i,j:integer;
begin
rab:=ListBox5.itemindex;
for i:=1 to NFF do
if BaseKnow.Rule[rab+1].Number=VectFact[i].Number then
begin
listbox6.Items.Add(VectFact[i].Znach);
NK:=NK+1;
Knowledge[NK]:=VectFact[i].Number;
end;
end;

Procedure Direct;
var
KIZ,NS,KA,k,i,l,j:integer;
begin
{Oaia?ue aeai?eoi i?yiiai oiaea}
KEnd:=0;KIZ:=0;NS:=0;

While ((KEnd=0) and (KIZ=0)) do
begin
{i?aaiecaoeey ia?aaioee AC aei oao ii?, iiea ia iieo/ei}
{o?aaoaiia oeaeaaia cia/aiea eee ia noaiao ynia }
{iaaiciiaeiinoue aai iieo/aiey}
KIZ:=1;
i:=1;
While (i<=NR) and (Kend=0) do begin {I?iniio? anao i?aaee aei ii?iaeaeaiey} {oeaeaaiai oaeoa} KA:=0; {I?iaa?ea: ioaeii ee ii?iaeaeaoue oaeo?} k:=1; While ((KA=0) and (K<=NF)) do begin if BaseKnow.Rule[i].Number=BaseKnow.Fact[k] then KA:=1; {Oaeo aoiaeeo a iiiaeanoai eiathueony} k:=k+1; end; {I?iaa?ea: iiaeii ee ii?iaeeoue oaeo?} j:=1; While ((j<=BaseKnow.Rule[i].Q) and (KA=0)) do begin {Aiaeec ii?iaeaeathueo oaeoia} KA:=1; k:=1; While (k<=NF) and (KA=1) do begin {I?iaa?ea iaee/ey ii?iaeaeathuaai oaeoa} {anoue ee oaeo a AC} if BaseKnow.Rule[i].FactIn[j]=BaseKnow.Fact[k] then KA:=0; k:=k+1; end; {anee i?e auoiaea EA=1, oi iao oaeoa,} {iaiaoiaeeiiai aeey ii?iaeaeaiey} j:=j+1; end;if KA=0 then begin {Ana oaeou, iaiaoiaeeiua aeey ii?iaeaeaiey} {iiaiai oaeoa, anoue a iaee/ea} NF:=NF+1; BaseKnow.Fact[NF]:=BaseKnow.Rule[i].Number; KIZ:=0; {I?iaa?ea: yaeyaony ey ii?iaeaeaiiue oaeo} {oeaeaaui} if BaseKnow.Rule[i].Zel=1 then begin KEND:=1; Rez:=BaseKnow.Rule[i].Number; end;end; i:=i+1; end; {Eiiaoe i/a?aaeiiai i?iniio?a anao i?aaee} {Eiiaoe ia?aaioee AC} end;end;Procedure Inv; var KVPC,KVPF,AnFact,NS1,Rab,FindFactAn:integer; L,NS,i,j,k,KA:integer; begin {Aeai?eoi ia?aoiiai oiaea} KEnd:=0; L:=1; NST:=0; While (L<=NK) do begin {I?aaiecaoeey i?iniio?a anao oeaeaauo} {oaeoia, iiea ia iiaeoaa?aeeony aiciiaeiinoue} {ii?iaeaeaiey eaeia-e. ec ieo} KEND:=0; Nst:=Nst+1; Spis[Nst]:=Knowledge[l]; While (Kend=0)do begin FindFactAn:=0; j:=0; While (FindFactAn=0)and( j<=NST) do {auai? oaeoa aeey aiaeeca} begin for k:=1 to NR do if BaseKnow.Rule[k].Number=Spis[j] then begin FindFactAn:=1; {Euai, anoue ee i?aaeei} AnFact:=Spis[j]; {eioi?ia iiaeii ii?iaeeoue} for i:=j to Nst-1 do Spis[i]:=Spis[i+1]; Nst:=Nst-1; end; j:=j+1; end; if FindFactAn=0 then KEnd:=1 {Oaeoa aeey aiaeeca iao, eiiaoe aiaeeca} else begin i:=1; While (I<=NR) do begin {aiaeec aici-oe ii?iaeaeaiey} {aua?aiiiai oaeoa} if AnFact=BaseKnow.Rule[i].Number then begin {o?aaoaiue oaeo yaeyaony ii?iaeaeaiiui} for j:=1 to BaseKnow.Rule[i].Q do begin NST:=NST+1; Spis[Nst]:=BaseKnow.Rule[i].FactIn[j]; end; end;{eiiaoe aiaeeca ii?iaeaeaaiiai oaeoa} i:=i+1; end;{While } end;end; l:=l+1; end;{Ieii/aiea ia?aaioee anao oeaeaauo oaeoia} if NST=NK then KEND:=0 else KEND:=1; {Ie iaeei ec oeaeaauo oaeoia ia iiaeao auoue ii?iaeaeai} end;procedure TForm1.BitBtn5Click(Sender: TObject); {iaaeaee eiiieo IE} var i,j,k,KA,l:integer; begin BitBtn5.enabled:=false; if (NF1<>0) and (NK=0) then {oaeou aaaaeaiu, oeaeue ia aaaaeaia}
begin
Direct;
if Kend<>0 then
begin
for i:=1 to NFF do
if VectFact[i].Number=Rez then
ListBox6.Items.Add(VectFact[i].Znach);
Label10.Caption:=’Au i?eaioiaeoa:’;
Label10.Font.Color:=clnavy;
end
else
Application.MessageBox(‘Ec aua?aiiuo eiiiiiaioia ie/aai iaeuecy i?eaioiaeoue!’,’Ioeaea!’,mb_iconwarning);
end;
if (NF1=0) and (NK<>0) then {oaeou ia aaaaeaiu, oeaeue aaaaeaia}
begin
Inv;
if KEnd<>0 then
begin
for i:=1 to NST do
for j:=1 to NFF do
if Spis[i]=VectFact[j].Number then
ListBox4.Items.Add(VectFact[j].Znach);
Label8.Caption:=’Aai iaiaoiaeeii:’;
Label8.Font.Color:=clnavy;
end;
end;
if (NK<>0) and (NF1<>0) then {aiaeec ia niaiaaeaiea oaeoia n oeaeueth}
begin
k:=1;
While (k<=NR) do begin {Anee anoue ii?iaeaeaaiua oaeou} i:=1; {oi ?aneeaaeuaaai eo ia i?inoua ninoaaeythuea} KA:=0; While (i<=NF1)and (KA=0) do begin if BaseKnow.Rule[k].Number=SpisF[i] then begin for j:=i to NF1-1 do SpisF[j]:=SpisF[j+1]; NF1:=NF1-1; KA:=1; end; i:=i+1; end; if KA=1 then begin for i:=1 to BaseKnow.Rule[k].Q do begin NF1:=NF1+1; SpisF[NF1]:=BaseKnow.Rule[k].FactIn[i]; end; k:=0; end; k:=k+1; end;INV;i:=1; While i<=NF1 do {I?iaa?ea, /oi eeoiaa} begin {eee /aai ia oaaoaao} KA:=0; j:=1; While (j<=NST) and (KA=0) do begin if SpisF[i]=Spis[j] then Ka:=1; j:=j+1; end; if KA=1 then begin for k:=i to NF1-1 do SpisF[k]:=SpisF[k+1]; i:=i-1; NF1:=NF1-1; for l:=j-1 to NST-1 do Spis[l]:=Spis[l+1]; NST:=Nst-1; end; i:=i+1; end; if (Nst=0)and (NF1=0) then Timer2.Enabled:=true else begin KA:=0; for i:=1 to NST do for j:=1 to NFF do begin if (Spis[i]=VectFact[j].Number) and (KA=0) then begin combobox2.Text:=VectFact[j].Znach; KA:=1; end; if (Spis[i]=VectFact[j].Number) and (KA=1) then combobox2.Items.Add(VectFact[j].Znach); end; KA:=0; for i:=1 to NF1 do for j:=1 to NFF do begin if (SpisF[i]=VectFact[j].Number) and (KA=0) then begin combobox1.Text:=VectFact[j].Znach; KA:=1; end; if (SpisF[i]=VectFact[j].Number) and (KA=1) then combobox1.Items.Add(VectFact[j].Znach); end; end; end; if (Nk=0) and (NF1=0) then begin Application.MessageBox('Enoiaeiua aeaiiua ia aaaaeaiu!','Ioeaea',mb_iconwarning); BitBtn5.Enabled:=true; end; end;procedure TForm1.BitBtn6Click(Sender: TObject); begin listbox4.Items.Clear; listbox6.Items.Clear; label10.Caption:='Aua?aiiua oeaee'; label8.Caption:='Aua?aiiua oaeou'; Label10.Font.Color:=cllime; Label8.Font.Color:=cllime; NK:=0; NF1:=0; label13.Visible:=false; label13.Top:=104; ComboBox1.Clear; ComboBox2.Clear; BitBtn5.enabled:=true; end;procedure TForm1.Timer2Timer(Sender: TObject); begin label13.Visible:=true; label13.top:=label13.top+2; if label13.top=150 then timer2.Enabled:=false; end;procedure TForm1.LoadBase; var i:integer; FF: TFF; FactFile:TFactFile; begin i:=0; OpenDialog1.Filter:='Aaca ciaiee|*.dat'; if not OpenDialog1.Execute then exit; if FileExists(OpenDialog1.FileName)=false then begin Application.MessageBox('Oaee n oaeei eiaiai ia iaeaeai!','Error',MB_iconwarning); exit; end else begin AssignFile(FF,OpenDialog1.FileName); reset(FF); NR:=0; NFF:=0; While Not eof(FF) do begin Read(FF,FactFile); NFF:=NFF+1; VectFact[NFF].Number:=FactFile.Number; VectFact[NFF].Znach:=FactFile.Znach; ListBox3.Items.Add(VectFact[NFF].Znach); ListBox1.Items.Add(VectFact[NFF].Znach); if FactFile.Q>1 then
begin
NR:=NR+1;
BaseKnow.Rule[NR].Number:=FactFile.Number;
BaseKnow.Rule[NR].Zel:=FactFile.Zel;
ListBox5.Items.Add(FactFile.Znach);
BaseKnow.Rule[NR].Q:=FactFile.Q;
for i:=1 to BaseKnow.Rule[NR].Q do
BaseKnow.Rule[NR].FactIn[i]:=FactFile.FactIn[i];
end;
end;
end;
closefile(FF);
end;

procedure TForm1.SpeedButton6Click(Sender: TObject);
var
inf:integer;
begin
inf:=Application.Messagebox(‘Caa?oceoue iiaoth AC?’,’Question’,MB_YESNO+MB_ICONQUESTION);
if inf=idNO then
exit;
if inf=idYes then
begin
ListBox1.Clear;
ListBox2.Clear;
ListBox3.Clear;
ListBox4.Clear;
ListBox5.Clear;
ListBox6.Clear;
LoadBase;
end;
end;

procedure TForm1.SaveBase;
var i,k,j:integer;
FF: TFF;
FactFile:TFactFile;
begin
SaveDialog1.Filter:=’Aaca ciaiee|*.dat’;
if SaveDialog1.Execute then
begin
assignfile(FF,SaveDialog1.filename);
rewrite(FF);
for i:=1 to NFF do
Begin
FactFile.Number:=VectFact[i].Number;
FactFile.Znach:=VectFact[i].Znach;
FactFile.Q:=0;
FactFile.Zel:=0;
for j:=1 to NR do
if VectFact[i].Number=BaseKnow.Rule[j].Number then
begin
FactFile.Q:= BaseKnow.Rule[j].Q;
FactFile.Zel:= BaseKnow.Rule[j].Zel;
for k:=1 to BaseKnow.Rule[j].Q do
FactFile.FactIn[k]:=BaseKnow.Rule[j].FactIn[k];
end;
write(ff,FactFile);
end;
end
else exit;
closefile(FF);
end;

procedure TForm1.SpeedButton7Click(Sender: TObject);
begin
SaveBase;
end;

procedure TForm1.ListBox1Click(Sender: TObject);
var
i,j,rab,r,t:integer;
begin
label6.Visible:=true;
t:=0;
ListBox2.Clear;
rab:=ListBox1.Itemindex;
for i:=1 to NR do
if VectFact[rab+1].Number=BaseKnow.Rule[i].Number then
begin
t:=1;
for j:=1 to BaseKnow.Rule[i].Q do
for r:=1 to NFF do
if VectFact[r].Number=BaseKnow.Rule[i].FactIn[j]then
ListBox2.Items.Add(VectFact[r].Znach);
end;
if t=1 then
label6.Caption:=’Ii?iaeaeaaiue oaeo’;
if t=0 then
label6.Caption:=’I?inoie oaeo’;
{}
end;

procedure TForm1.SpeedButton4Click(Sender: TObject);
begin
speedbutton6.Enabled:=false;
speedbutton7.Enabled:=false;
speedbutton8.Enabled:=false;
panel1.Visible:=true;
edit1.Visible:=true;
combobox3.Visible:=true;
radiogroup1.Visible:=true;
radiogroup1.ItemIndex:=0;
Num:=0;
edit1.SetFocus;
edit1.Clear;
end;

procedure TForm1.SpeedButton10Click(Sender: TObject);
begin
panel1.Visible:=false;
edit1.Visible:=false;
combobox3.Visible:=false;
radiogroup1.Visible:=false;
speedbutton11.visible:=false;
speedbutton6.Enabled:=true;
speedbutton7.Enabled:=true;
speedbutton8.Enabled:=true;
end;

procedure TForm1.RadioGroup1Click(Sender: TObject);
begin
if radiogroup1.ItemIndex=0 then
begin
combobox3.Enabled:=false;
label14.Enabled:=false;
speedbutton11.visible:=false;
edit1.SetFocus;
end;
if radiogroup1.ItemIndex=1 then
begin
combobox3.Enabled:=true;
label14.Enabled:=true;
speedbutton11.visible:=true;
edit1.SetFocus;
end;
end;

procedure TForm1.AddSimpleFact;
var
i,t:integer;
r:string;
begin
r:=edit1.text;
for i:=1 to NFF do
if r=VectFact[i].Znach then
begin
Application.MessageBox(‘Oaeie oaeo oaea nouanoaoao!’,’Ioeaea’,mb_iconwarning);
exit;
end;
t:=VectFact[NFF].Number;
NFF:=NFF+1;
VectFact[NFF].Number:=t+1;
VectFact[NFF].Znach:=r;
ListBox1.items.add(VectFact[NFF].Znach);
ListBox3.items.add(VectFact[NFF].Znach);
end;

procedure TForm1.AddComplexFact;
var
i,t:integer;
r:string;
begin
r:=edit1.text;
for i:=1 to NFF do
if r=VectFact[i].Znach then
begin
Application.MessageBox(‘Oaeie oaeo oaea nouanoaoao!’,’Ioeaea’,mb_iconwarning);
exit;
end;
t:=VectFact[NFF].Number;
NFF:=NFF+1;
VectFact[NFF].Number:=t+1;
VectFact[NFF].Znach:=r;
ListBox1.items.add(VectFact[NFF].Znach);
ListBox3.items.add(VectFact[NFF].Znach);
ListBox5.items.add(VectFact[NFF].Znach);
NR:=NR+1;
BaseKnow.Rule[NR].Number:=VectFact[NFF].Number;
BaseKnow.Rule[NR].Q:=Num;
BaseKnow.Rule[NR].Zel:=1;
for i:=1 to Num do
BaseKnow.Rule[NR].FactIn[i]:=SpisF[i];

end;

procedure TForm1.SpeedButton9Click(Sender: TObject);
begin
if radiogroup1.ItemIndex=0 then
if edit1.Text=” then
begin
Application.MessageBox(‘Ia aaaaeaiu aeaiiua!’,’Ioeaea’,mb_iconwarning);
exit;
end
else
AddSimpleFact;

if radiogroup1.ItemIndex=1 then
if (edit1.Text=”) or (ComboBox3.Text=”)or (Num=0)then
begin
Application.MessageBox(‘Aaaaeaiu ia ana aeaiiua!’,’Ioeaea’,mb_iconwarning);
exit;
end
else
begin
AddComplexFact;
combobox3.Clear;
end;
edit1.Clear;
Num:=0;
end;

procedure TForm1.SpeedButton11Click(Sender: TObject);
var rab:integer;
begin
rab:=ListBox1.itemindex;
ComboBox3.Items.Add(VectFact[rab+1].Znach);
ComboBox3.ItemIndex:=0;
Num:=Num+1;
SpisF[Num]:=VectFact[rab+1].Number;
end;

procedure TForm1.DeleteFact;
var
i,j,rab,t,k:integer;
begin
rab:=ListBox1.ItemIndex+1;
k:=VectFact[rab].Number;

for i:=1 to NR do
for j:=1 to BaseKnow.Rule[i].Q do
if BaseKnow.Rule[i].FactIn[j]=k then
begin
Application.MessageBox(‘Aeey nio?aiaiey oeaeinoiinoe aacu oaeaeeoa aia/aea oaeo, niaea?aeauee a naaa aeaiiue!’,’I?aaeoi?aaeaeaiea’,mb_iconwarning);
exit;
end;

for i:=rab to NFF-1 do
begin
VectFact[i].Number:=VectFact[i+1].Number;
VectFact[i].Znach:=VectFact[i+1].Znach;
end;
NFF:=NFF-1;
for i:=1 to NR do
if k=BaseKnow.Rule[i].Number then
begin
for t:=i to NR-1 do
begin
BaseKnow.Rule[t].Number:=BaseKnow.Rule[t+1].Number;
BaseKnow.Rule[t].Q:=BaseKnow.Rule[t+1].Q;
BaseKnow.Rule[t].Zel:=BaseKnow.Rule[t+1].Zel;
for j:=1 to BaseKnow.Rule[t].Q do
BaseKnow.Rule[t].FactIn[j]:=BaseKnow.Rule[t+1].FactIn[j];
end;
NR:=NR-1;
end;

ListBox1.Clear;
ListBox2.Clear;
ListBox3.Clear;
ListBox5.Clear;
for i:=1 to NFF do
begin
ListBox1.Items.Add(VectFact[i].Znach);
ListBox3.Items.Add(VectFact[i].Znach);
for j:=1 to NR do
if VectFact[i].Number=BaseKnow.Rule[j].Number then
ListBox5.Items.Add(VectFact[i].Znach);
end;

end;

procedure TForm1.SpeedButton5Click(Sender: TObject);
var
inf:integer;
begin
inf:=Application.Messagebox(‘Oaeaeeoue oaeo?’,’Question’,MB_YESNO+MB_ICONQUESTION);
if inf=idNO then
exit;
if inf=idYes then
DeleteFact;
end;

procedure TForm1.BitBtn2Click(Sender: TObject);
var
rab,i,j:integer;
begin
if NF1>0 then
begin
rab:=ListBox4.Itemindex;
for i:=rab+1 to NF1-1 do
begin
SpisF[i]:=SpisF[i+1];
BaseKnow.Fact[i]:=BaseKnow.Fact[i+1];
end;
NF1:=NF1-1; NF:=NF1;
ListBox4.Clear;
for i:=1 to NF1 do
for j:=1 to NFF do
if SpisF[i]=VectFact[j].Number then
ListBox4.Items.Add(VectFact[j].Znach);
end;
end;

procedure TForm1.BitBtn4Click(Sender: TObject);
var
rab,i,j:integer;
begin
if NK>0 then
begin
rab:=ListBox6.Itemindex;
for i:=rab+1 to NK-1 do
Knowledge[i]:=Knowledge[i+1];
NK:=NK-1;
ListBox6.Clear;
for i:=1 to NK do
for j:=1 to NFF do
if Knowledge[i]=VectFact[j].Number then
ListBox6.Items.Add(VectFact[j].Znach);
end;
end;

procedure TForm1.N5Click(Sender: TObject);
begin
HelpBox.show;
end;

procedure TForm1.N4Click(Sender: TObject);
begin
close;
end;

end.

5.2.?ania/aoea ye?aiiuo oi?i

Canoaaea


Aue aua?ai ioieo iaith ?aaioa n nenoaiie


Ieii ioieoa iaith I?aaea



Iieueciaaoaeue iiaeaeae aeiaaaeoue oaeo, ioia?aceeinue ieioei



 A ieia I?aaea iiaeii i?iniio?aoue ana oaeou, i?e yoii ociaoue eo noaoon e ninoaa

PAGE 13

PAGE 1

Нашли опечатку? Выделите и нажмите CTRL+Enter

Похожие документы
Обсуждение

Оставить комментарий

avatar
  Подписаться  
Уведомление о
Заказать реферат
UkrReferat.com. Всі права захищені. 2000-2019