All Downloads are FREE. Search and download functionalities are using the official Maven repository.

j.stdlib.4.6.0-P.source-code.VDMUtil.vdmsl Maven / Gradle / Ivy

The newest version!
-- @NoPOG - do not generate obligations for this module
module VDMUtil

-- 	VDMTools STANDARD LIBRARY: MiscUtils
--      --------------------------------------------
-- 
-- Standard library for the VDMTools Interpreter. When the interpreter
-- evaluates the preliminary functions/operations in this file,
-- corresponding internal functions is called instead of issuing a run
-- time error. Signatures should not be changed, as well as name of
-- module (VDM-SL) or class (VDM++). Pre/post conditions is 
-- fully user customisable. 
-- Dont care's may NOT be used in the parameter lists.

exports all
definitions
functions
-- Converts a set argument into a sequence in non-deterministic order.
set2seq[@T] : set of @T +> seq of @T
set2seq(x) == is not yet specified;

-- Returns a context information tuple which represents
-- (fine_name * line_num * column_num * module_name * fnop_name) of corresponding source text
get_file_pos : () +> [ seq of char * nat * nat * seq of char * seq of char ]
get_file_pos() == is not yet specified;

-- Converts a VDM value into a seq of char.
val2seq_of_char[@T] : @T +> seq of char
val2seq_of_char(x) == is not yet specified;

-- converts VDM value in ASCII format into a VDM value
-- RESULT.#1 = false implies a conversion failure
seq_of_char2val[@p]:seq1 of char -> bool * [@p]
seq_of_char2val(s) ==
let mk_(b, v) = seq_of_char2val_(s) in
    if is_(v, @p) then mk_(b, v) else mk_(false, nil)
post let mk_(b,t) = RESULT in not b => t = nil;
 
seq_of_char2val_:seq1 of char -> bool * ?
seq_of_char2val_(s) == is not yet specified

end VDMUtil




© 2015 - 2024 Weber Informatics LLC | Privacy Policy