Presentation is loading. Please wait.

Presentation is loading. Please wait.

I.L. Bratchikov, I.S.Lebedev Saint-Petersburg State University

Similar presentations


Presentation on theme: "I.L. Bratchikov, I.S.Lebedev Saint-Petersburg State University"— Presentation transcript:

1 I.L. Bratchikov, I.S.Lebedev Saint-Petersburg State University
Text specifications usage for program code generation

2 Text specifications example
1.The Application shall provide the user with the test description before Camera Test execution. 2.During the Camera Test the Application shall prompt the user to capture the image. 3.The user shall be able to confirm and reject the result of the Camera Test in response to the test question.

3 Semantic natural language model Prof. V.A.Tusov
Morphology level Syntactic level Semantic level Semantic предикат SemSint(A1~K1,…,An~Kn) Ai – morphology information Ki - classification information System of functions for action identification and word иерархия apply to translate natural language construction on “semantic” language

4 Main part of specifications
Condition Object Operation

5 Automatic specifications processing
The Application shall provide the user with the test description before Camera Test execution. N% word struction type shall provide [action] before [when?] Test [what?] Camera [what?] execution [what?] The Application [what?] the user [whom?] description [what?] test [what?]

6 Adaptive semantic natural language model
Morphology level Syntactic level Semantic level Syntactic предикат Sint(A1,…,An) Ai - morphology information + Priority system for construction connection SGT, Ki =17 SGT part of speech

7 Specification analysis
Semantic-morphology markers -> < Condition: before Camera Test execution > < Action: The Application shall provide the user with the test description > < Object: << Application >> >

8 Object template <OBJECT: << Application >>
PARAMETR-CONDITION1 : Before Camera Test execution; PARAMETR-CONDITION 2 : During the Camera Test; <ACTION1: shall provide the user with the test description > < ACTION2: shall prompt the user to capture the image > >

9 Object code template class App
{ bool par1; // PARAMETR-CONDITION1 : Before // Camera Test execution; bool par2; // PARAMETR-CONDITION1 : During // Camera Test execution; obj action1(); //<ACTION1: shall provide the user //with the test description > obj action2(); // < ACTION2: shall prompt the user // to capture the image > };

10 Notation code template
1. If (Test.execution == true) { par2=true; App_.action2(par2); } 2. if (par1==true) App_.action1(par1);

11 Application code frame
App_.initialization(); While(App_.param_n== true) Switch(App_.condition) { case 1: App_.action1(par1); break; case 2: App_.action2(par2); break; ... case N: App_.actionN(parN); break; default : }

12 Structure calculation
If the user has pressed the button to display the message. N% word struction type If [condition] has pressed [action] user [who?] the button [what?] to display [action] the message [what?] < Condition: If the user has pressed the button > < Action: to display the message < Object: << message >> >

13 Objects from structure
the Message the User the Screen the Button

14 Object identification
Type Synonym Type_Message *OBJ_Message Message, signal… Type_User *OBJ_User User.... Type_Consol *OBJ_Consol Screen, Console, Terminal... Type_Button *OBJ_Button Button...

15 Function identification
Synonym Tipe_CondApp Press(Tipe_Button *, Tipe_Obj *,...) To press, activate etc. Tipe_CondApp Print(Tipe_ Message *, Tipe_Obj *, ...) to output, print out etc.

16 Unit.h Tipe_Message *OBJ_Message_1; Tipe_User *OBJ_User_1; Tipe_Consol *OBJ_Consol_1; Tipe_CondApp Press(Tipe_Button *OBJ_Button, Tipe_User *OBJ_User ) { } Tipe_CondApp Print(Tipe_ Message *OBJ_Message, Tipe_Consol *OBJ_Consol)

17 Code generation void Main (void) { ...
if(Press(OBJ_Button, OBJ_User )) Print(OBJ_Message, OBJ_Consol); }

18 Conclusion Basic development of programming technologies is set by methods of automatic processing of the information and knowledge. Using the described approach it is possible to calculate objects of the program and communications between them.


Download ppt "I.L. Bratchikov, I.S.Lebedev Saint-Petersburg State University"

Similar presentations


Ads by Google