CN107562430A - A kind of Compilation Method of file process function for mobile π algorithmic language - Google Patents

A kind of Compilation Method of file process function for mobile π algorithmic language Download PDF

Info

Publication number
CN107562430A
CN107562430A CN201710865364.XA CN201710865364A CN107562430A CN 107562430 A CN107562430 A CN 107562430A CN 201710865364 A CN201710865364 A CN 201710865364A CN 107562430 A CN107562430 A CN 107562430A
Authority
CN
China
Prior art keywords
file
function
write
mobile
algorithmic language
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710865364.XA
Other languages
Chinese (zh)
Other versions
CN107562430B (en
Inventor
康辉
李柏润
徐男
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jilin University
Original Assignee
Jilin University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jilin University filed Critical Jilin University
Priority to CN201710865364.XA priority Critical patent/CN107562430B/en
Publication of CN107562430A publication Critical patent/CN107562430A/en
Application granted granted Critical
Publication of CN107562430B publication Critical patent/CN107562430B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Devices For Executing Special Programs (AREA)
  • Stored Programmes (AREA)

Abstract

The invention belongs to concurrent communication field, it is related to a kind of Compilation Method of the file process function for mobile π algorithmic language, including writing library file, compiling npict files, modification runtime system file, generation executable program, this method is by using file approach technology, it have effectively achieved the file process function of mobile π algorithmic language, and corresponding abnormality processing is carried out to the possible unusual condition of file process function, the miscue of close friend is provided, there is good robustness.So as to more effectively handle mass data, more directly interacted with user, data are setup flexibly, compensate for then further promoting π calculations and its popularization and development of programming language to the missing of mobile π algorithmic language file process functions in current field.

Description

A kind of Compilation Method of file process function for mobile π algorithmic language
Technical field
The invention belongs to mobile communication, concurrent field, is related to Nomadic Pict (mobile π algorithmic language), especially It is related to a kind of Compilation Method of the file process function for mobile π algorithmic language.
Background technology
π calculations are to be schemed spirit prize winner Luo Bin Jerry Millners by the famous scientist of Britain in 1991 and proposed.It is a kind of For describing and analyzing the computational model of concurrent system.Calculus of communicating systems has been promoted in π calculations, it is allowed to transmission channels in the communications Name so that π calculation can describe Communication topology dynamic change, there is powerful ability to express, while inherit again Semantic theory --- the Mutual simulation of the precision and elegance of calculus of communicating systems.π calculations have been applied to programming language The fields such as design, the analysis of distributed system and checking, generate wide influence.Pict (π algorithmic language) language is one The simple advanced concurrent language using π calculations.π algorithmic language possesses oneself unique processing mode, and is calculated very close to π Thought.Because the value of variable cannot change in π calculations, multiple processes are just not present and changes a variable simultaneously and causes The problem of " deadlock ", this just reduces the cost of con current control, to provide great convenience parallel.
Because π algorithmic language is the basic language of earliest description π calculations, and Nomadic Pict (mobile π algorithmic language) Extended on the basis of π algorithmic language is inherited and to it so that the communication between mobile agent is unrelated with position. But the compiling system of mobile π algorithmic language has lacked file process function compared with the compiling system of π algorithmic language.And π is calculated File process function in language system is realized in a manner of inline c functions, portable and bad, and mobile π is drilled The virtual machine for calculating language is not supported to explain execution c programs, so having no way of using for reference.
When algorithm is related to such as mass data, view data, geographic information data, data will not typically write on program In, it can be handled by file, and if the compiling system of mobile π algorithmic language directly handles a large amount of numbers in a program According to because running memory is limited, so as to internal memory be caused to overflow, program can not be run.Under same situation, c programs Mass data can be handled by file, so working as and c language contrasts, it was demonstrated that the superiority of the mobile parallel aspect of π algorithmic language When, it is necessary to meet the condition of control experiment, so must have file process function.And file process function is handed over user Mutual most direct function, the processing for data also more flexibly, program code also more succinct specification.π algorithmic language is just located In development, the researcher of many π algorithmic language at present is manually entered mass data, very cumbersome;And algorithm once relates to And to mass data, even if time-consumingly going very much to input mass data manually, program also most likely results in internal memory and overflows, blocks It can not run.So being badly in need of a kind of Compilation Method of the file process function for mobile π algorithmic language, could more effectively solve Certainly these problems, further promote π calculations and its popularization and development of programming language.
The content of the invention
It is an object of the invention to the deficiency for above-mentioned existing compiler, there is provided a kind of for moving π algorithmic language The Compilation Method of file process function.
The purpose of the present invention is achieved through the following technical solutions:
A kind of file process function Compilation Method for mobile π algorithmic language, comprise the following steps:
A, library file is write
In mobile π algorithmic language java standard libraries, the source file and npict files of writing file process function (use mobile π The file that algorithmic language is write);
B, npict files are compiled
Write order in the terminal, the npict files write in Complied executing step A, system can perform during generating run Intermediate code file;
C, runtime system file is changed
Using the file approach technology in intermediate code language, write corresponding with each function in npict files in step A Bottom code, and carry out corresponding abnormality processing;
D, executable program is generated
The module interface of corresponding source file compiling and the compiled bytecode obj ect file of module realization are deleted, deletes and works as Preceding executable file, whole npict bottoms compiler associated documents are recompilated, generate final executable program.
Step A, the library file of writing specifically include following steps:
Source file is created, this document class name, the statement of file correlation function, function performance explanation, file defined in file Related Inline Function statement, function call abbreviation;Create npict files corresponding with source file.
Step B, the compiling npict files specifically include following steps:
Opened a terminal in mobile π algorithmic language java standard libraries, input corresponding compiler directive and perform, system during generating run Executable intermediate code file.
Step C, the file approach be divided into it is read-only, only write, add, binary mode, Text Mode.
Step C, the modification runtime system file specifically include following steps:
C1, operationally write and this document class corresponding instruction in system file;
C2, file operationally is write in system file writes correlation function bottom code;
C3, file is operationally write in system file read correlation function bottom code;
C4, each function operationally is write in system file corresponds to exception handler.
Step C2, the file are write correlation function and parsed including file approach type, the Text Mode of fundamental type data Write correlation function, binary mode writes correlation function, the lookup and setting of file current write location, written document passage wash away, meter Calculate written document size.
Step C3, the file are read correlation function and parsed including file approach type, the Text Mode of fundamental type data Read correlation function, binary mode reads correlation function, the lookup and setting of the current reading location of file, calculating reading file size.
Step D, the compiling npict files specifically include following steps:
The compiled bytecode obj ect file that the module interface of the source file being altered compiling and module are realized is deleted, deleted Except former executable file, opened a terminal under this document catalogue, run compiler directive, regenerate the mould of source file compiling The compiled bytecode obj ect file and last executable program that block interface, module are realized.
Compared with existing mobile π algorithmic language compiling system, beneficial effects of the present invention are:Realize associated documents processing Function, processing data are more flexible
Brief description of the drawings
Fig. 1 is a kind of schematic flow sheet of file process function Compilation Method for mobile π algorithmic language of the present invention;
Fig. 2 is that file writes basic command and experimental result picture in the present invention;
Fig. 3 is the reading basic command and experimental result picture of file in the present invention;
Fig. 4 is that the file data of isomery algorithm on earliest finish time in the present invention reads algorithm pattern;
Fig. 5 is isomery algorithm experimental on earliest finish time result part sectional drawing in the present invention;
Fig. 6 is abnormality processing error message prompting figure in the present invention.
Embodiment
Called the turn in a program design language, file process function is very important part.And it is and user The most direct function of interaction so that the processing of data is more flexible.When routine data is related to such as mass data, picture number During according to, geographic information data, data will not typically be write in a program, can be handled by file.And current mobile π is drilled The compiling system of calculation language lacks the process of compilation to file related fields, if the compiling system of mobile π algorithmic language is direct Mass data is handled in a program, and because internal memory is limited, so as to internal memory be caused to overflow, program can not be run.And π is calculated Developing stage is in, many auxiliary facilities are perfect not enough, due to the missing of the correlation function of file process so that many should The researcher in field runs into bottleneck, so being badly in need of a kind of Compilation Method of the file process function for mobile π algorithmic language, The development of π algorithmic language can further be promoted.
The present invention provides a kind of file process function Compilation Method for mobile π algorithmic language, by mobile π calculations In language standard storehouse, the source file and npict files of file process function are write, files classes and correlation function is defined, uses text Part passage technology, operationally system write bottom code corresponding with java standard library system file.The present invention calculates for mobile π The file process function Compilation Method of language includes writing library file, compiling npict files, modification runtime system file, life Into executable program, its schematic flow sheet refers to Fig. 1.
A kind of file process function Compilation Method for mobile π algorithmic language, comprise the following steps:
A, library file is write
In mobile π algorithmic language java standard libraries, the source file and npict files of file process function are write;
B, npict files are compiled
Write order in the terminal, the npict files write in Complied executing step A, system can perform during generating run Intermediate code file;
C, runtime system file is changed
Using the file approach technology in intermediate code language, write corresponding with each function in npict files in step A Bottom code, and carry out corresponding abnormality processing;
D, executable program is generated
The module interface of corresponding source file compiling and the compiled bytecode obj ect file of module realization are deleted, deletes and works as Preceding executable file, whole npict bottoms compiler associated documents are recompilated, generate final executable program.
Step A, the library file of writing specifically include following steps:
Source file is created, this document class name, the statement of file correlation function, function performance explanation, file defined in file Related Inline Function statement, function call abbreviation;Create npict files corresponding with source file.
Step B, the compiling npict files specifically include following steps:
Opened a terminal in mobile π algorithmic language java standard libraries, input corresponding compiler directive and perform, system during generating run Executable intermediate code file.
Step C, the file approach be divided into it is read-only, only write, add, binary mode, Text Mode.
Step C, the modification runtime system file specifically include following steps:
C1, operationally write and this document class corresponding instruction in system file;
C2, file operationally is write in system file writes correlation function bottom code;
C3, file is operationally write in system file read correlation function bottom code;
C4, each function operationally is write in system file corresponds to exception handler.
Step C2, the file are write correlation function and parsed including file approach type, the Text Mode of fundamental type data Write correlation function, binary mode writes correlation function, the lookup and setting of file current write location, written document passage wash away, meter Calculate written document size.
Step C3, the file are read correlation function and parsed including file approach type, the Text Mode of fundamental type data Read correlation function, binary mode reads correlation function, the lookup and setting of the current reading location of file, calculating reading file size.
Step D, the compiling npict files specifically include following steps:
The compiled bytecode obj ect file that the module interface of the source file being altered compiling and module are realized is deleted, deleted Except former executable file, opened a terminal under this document catalogue, run compiler directive, regenerate the compiling of .mli source files Module interface, module realize compiled bytecode obj ect file and last executable program.
Embodiment 1:Basic read-write capability experiment
For the file process function Compilation Method of mobile π algorithmic language, the present invention gives file read-write function A kind of basic realization.The most important function of file process is by the demand storage write-in file of user and in file Content is read out on demand.Wherein the basic function of writing of file includes in the present invention:A character is write, writes character string, will Character string intercepts partial write file on demand, writes 8 integers (corresponding with ASCII character), in a binary format (4 byte) An integer is write, navigates to current write location according to demand, returns to current write location, returns to the size of presently written file (number of characters).File writes Basic function testing and experimental result refers to accompanying drawing 2, it can be seen that each single item function all normal operations, And expected result is obtained.
Test result indicates that the file process function Compilation Method that this kind is directed to mobile π algorithmic language can be realized successfully File writes basic function, and file provided by the present invention writes the enough users of basic function, and neatly storage write-in is literary on demand Part.
The reading basic function of file includes in the present invention:A character is read, reads a line character string, is read from given position Take the character of certain length to store into buffering character string and return to the number of characters actually read, a fixed length is read from given position The character storage of degree reads 8 integers (corresponding with ASCII character), reads a binary format (4 to buffering character string Byte) integer, current reading location is navigated to according to demand, returns to current reading location, returns to the current size (character for reading file Number).File writes Basic function testing and experimental result refers to accompanying drawing 3, it can be seen that each single item function all normal operations, and Expected result is arrived.
Test result indicates that the file process function Compilation Method that this kind is directed to mobile π algorithmic language can be realized successfully The reading basic function of file, file provided by the present invention read the enough users of basic function and neatly read file on demand.
By above experimental result, show file process function Compilation Method energy of the present invention for mobile π algorithmic language Compiling is enough successfully passed through, realizes the read-write basic function of file in mobile π algorithmic language.And file read-write processing is provided Abundant method, meets the needs of user, allows users to that file is more setup flexibly enough.
Embodiment 2:Mass data testing results
Due to a π algorithmic language inherently parallel language, mass data is handled in a parallel fashion and improves operational efficiency It is one of its very important target.And the compiling system of current mobile π algorithmic language is the absence of file process function, one Denier is related to the related algorithm of many big datas, the concurrent job task scheduling algorithm of magnanimity node etc., and these algorithms are related to If to mass data be written directly in program internal memory can be caused to overflow, program, which is blocked, to be run.And by all numbers According to writing in program, program code just seems tediously long, and is inconvenient to read.It is achieved that file process function can be with more Add and data are setup flexibly, program code is easy to read, more specification.And the algorithm that can be related to file with c language is carried out Control, so as to prove to move superiority of the π algorithmic language at parallel aspect.
In this experiment, when being completed earliest to the classic algorithm isomery of the concurrent job task scheduling using mass data node Between algorithm realized with mobile π algorithmic language.Node related data and processor related data are stored in file respectively, then Refering to Fig. 4, using file process function, by the data in file, circulation is read in so as to form the chained list of our needs successively on demand Etc. data structure, isomery algorithm on earliest finish time is then write, and gives progress task tune in the case of corresponding parallel processing Degree.
Experiments Results Section sectional drawing refers to Fig. 5, normal program operation, and operation result coincide with expected.It is indicated above that this hair The bright file process function Compilation Method for mobile π algorithmic language can be handled mass data by file, and Functional use is not had any impact.
Embodiment 3:For the robustness of the file process function Compilation Method of mobile π algorithmic language
The compiling system of one good programming language should have good robustness.When program is running into exception In the case of can also run or give user-friendly prompting.So file process of the present invention for mobile π algorithmic language Function Compilation Method provides abnormality processing and the miscue of correlation, can preferably help programmer to clear the state of mind, also help Code enhances readability, facilitates the reading and understanding of guardian.
So example 3 is tested for the unusual condition of file read-write processing function, for example, Invalid filename, write method Not specified effective character string, institute's reading location reach end of file, read in the work(such as the not specified effective character string of buffering character string Can, test result refers to Fig. 6.
Test result indicates that the present invention have effectively achieved the file process function of mobile π algorithmic language, and to file The possible unusual condition of processing function carries out corresponding abnormality processing, provides the miscue of close friend, has good robustness. So as to more effectively handle mass data, more directly interacted with user, data are setup flexibly, compensate for mesh To the missing of mobile π algorithmic language file process functions in preceding field, pushing away for π calculations and its programming language is then further promoted Wide and development.

Claims (8)

1. the Compilation Method of a kind of file process function for mobile π algorithmic language, it is characterised in that comprise the following steps:
A, library file is write
In Nomadic Pict (mobile π algorithmic language) java standard library, the source file and npict files of file process function are write (file write using mobile π algorithmic language);
B, npict files are compiled
Write order in the terminal, the npict files write in Complied executing step A, during system is executable during generating run Between code file;
C, runtime system file is changed
Using the file approach technology in intermediate code language, bottom corresponding with each function in npict files in step A is write Code, and carry out corresponding abnormality processing;
D, executable program is generated
The module interface of corresponding source file compiling and the compiled bytecode obj ect file of module realization are deleted, deletion currently may be used File is performed, whole npict bottoms compiler associated documents is recompilated, generates final executable program.
2. a kind of Compilation Method of file process function for mobile π algorithmic language according to claim 1, its feature It is, step A, the library file of writing specifically includes following steps:
Source file is created, this document class name, the statement of file correlation function, function performance explanation, file are related defined in file Inline Function statement, function call abbreviation;Create npict files corresponding with source file.
3. a kind of Compilation Method of file process function for mobile π algorithmic language according to claim 1, its feature It is, step B, the compiling npict files specifically include following steps:
Opened a terminal in mobile π algorithmic language java standard libraries, input compiler directive simultaneously performs, and system is executable during generating run Intermediate code file.
4. a kind of Compilation Method of file process function for mobile π algorithmic language according to claim 2, its feature It is:Step C, the file approach be divided into it is read-only, only write, add, binary mode, Text Mode.
5. a kind of Compilation Method of file process function for mobile π algorithmic language according to claim 1, its feature It is, step C, the modification runtime system file specifically includes following steps:
C1, operationally write and this document class corresponding instruction in system file;
C2, file operationally is write in system file writes correlation function bottom code;
C3, file is operationally write in system file read correlation function bottom code;
C4, each function operationally is write in system file corresponds to exception handler.
6. a kind of Compilation Method of file process function for mobile π algorithmic language according to claim 4, its feature It is:Step C2, the file are write correlation function and parsed including file approach type, and the Text Mode of fundamental type data writes phase Pass function, binary mode write correlation function, the lookup and setting of file current write location, and written document passage washes away, and calculating is write File size.
7. a kind of Compilation Method of file process function for mobile π algorithmic language according to claim 4, its feature It is:Step C3, the file are read processing function and parsed including file approach type, and the Text Mode of fundamental type data reads phase Close function, binary mode reads correlation function, the lookup and setting of the current reading location of file, calculating reading file size.
8. a kind of Compilation Method of file process function for mobile π algorithmic language according to claim 1, its feature It is, step D, the compiling npict files specifically include following steps:
By the source file being altered compiling module interface and module realize compiled bytecode obj ect file delete, delete with Preceding executable file, opened a terminal under this document catalogue, run compiler directive, the module for regenerating source file compiling connects The compiled bytecode obj ect file and last executable program that mouth, module are realized.
CN201710865364.XA 2017-09-22 2017-09-22 Compiling method for file processing function of mobile pi-calculus language Active CN107562430B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710865364.XA CN107562430B (en) 2017-09-22 2017-09-22 Compiling method for file processing function of mobile pi-calculus language

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710865364.XA CN107562430B (en) 2017-09-22 2017-09-22 Compiling method for file processing function of mobile pi-calculus language

Publications (2)

Publication Number Publication Date
CN107562430A true CN107562430A (en) 2018-01-09
CN107562430B CN107562430B (en) 2020-07-28

Family

ID=60982170

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710865364.XA Active CN107562430B (en) 2017-09-22 2017-09-22 Compiling method for file processing function of mobile pi-calculus language

Country Status (1)

Country Link
CN (1) CN107562430B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108319458A (en) * 2018-01-17 2018-07-24 南京航空航天大学 It is a kind of based on graphically defend formula order calculation multitask Compilation Method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102270130A (en) * 2011-06-27 2011-12-07 浙江工业职业技术学院 Formal description method for adaptive software architecture during operation
CN103259788A (en) * 2013-04-27 2013-08-21 天津大学 Formal modeling and validation method based on security protocols
CN103853559A (en) * 2014-03-12 2014-06-11 福建工程学院 Semantic Web service composite automatic validation method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102270130A (en) * 2011-06-27 2011-12-07 浙江工业职业技术学院 Formal description method for adaptive software architecture during operation
CN103259788A (en) * 2013-04-27 2013-08-21 天津大学 Formal modeling and validation method based on security protocols
CN103853559A (en) * 2014-03-12 2014-06-11 福建工程学院 Semantic Web service composite automatic validation method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108319458A (en) * 2018-01-17 2018-07-24 南京航空航天大学 It is a kind of based on graphically defend formula order calculation multitask Compilation Method

Also Published As

Publication number Publication date
CN107562430B (en) 2020-07-28

Similar Documents

Publication Publication Date Title
Rupp et al. ViennaCL---linear algebra library for multi-and many-core architectures
Treleaven et al. Data-driven and demand-driven computer architecture
US7207038B2 (en) Constructing control flows graphs of binary executable programs at post-link time
Martin PAG–an efficient program analyzer generator
Rauchwerger Run-time parallelization: Its time has come
Maksimović et al. Gillian, part II: real-world verification for javascript and C
Noaje et al. Source-to-source code translator: OpenMP C to CUDA
CN109829313A (en) A kind of method and device programming defence SGX side-channel attack based on code reuse
JP5059174B2 (en) Program conversion apparatus and program thereof
Ansel Autotuning programs with algorithmic choice
CN107562430A (en) A kind of Compilation Method of file process function for mobile π algorithmic language
Wenzel et al. Declarative programming for microcontrollers-Datalog on Arduino
Dooley et al. Detecting and using critical paths at runtime in message driven parallel programs
Kleine Büning et al. Using DimSpec for bounded and unbounded software model checking
Quinlan et al. Annotating user-defined abstractions for optimization
Batko et al. Actor model of Anemone functional language
Cierniak et al. Briki: an optimizing Java compiler
Metzler et al. Efficient verification of program fragments: Eager POR
Kowalewski et al. Debugging latent synchronization errors in MPI-3 one-sided communication
Aiken et al. A development environment for horizontal microcode programs
Antoy et al. A target implementation for high-performance functional programs
Winchenbach Framework zur effektiven Umsetzung von Fluidsimulationen auf GPUs
JP6907761B2 (en) compiler
Fernández et al. A reversible operational semantics for imperative programming languages
Batko et al. Actor Model of a New Functional Language-Anemone

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant