text
stringlengths
0
601k
let pattern_name pat = match pat . ppat_desc with Ppat_var s -> Some s | Ppat_constraint ( { ppat_desc = Ppat_var s } , _ ) -> Some s | _ -> None
let insertions = ref [ ]
let add_insertion pos s = insertions := ( pos , s ) :: ! insertions
let sort_insertions ( ) = List . sort ! insertions ~ cmp ( : fun ( pos1 , _ ) ( pos2 , _ ) -> pos1 - pos2 )
let is_space = function ' ' ' |\ t ' ' |\ n ' ' |\ r ' -> true | _ -> false
let is_alphanum = function ' A ' . . ' Z ' ' | a ' . . ' z ' ' | _ ' ' |\ 192 ' . . ' \ 214 ' ' |\ 216 ' . . ' \ 246 ' | ' \ 248 ' . . ' \ 255 ' ' ' ' ' |\| 0 ' . . ' 9 ' -> true | _ -> false
let rec insertion_point pos ~ text = let pos ' = ref ( pos - 1 ) in while is_space text . [ ! pos ' ] do decr pos ' done ; if text . [ ! pos ' ] = ' ( ' then insertion_point ! pos ' ~ text else if ! pos ' >= 5 && String . sub text ~ pos ( :! pos ' - 4 ) ~ len : 5 = " begin " && not ( is_alphanum text . [ ! pos ' - 5 ] ...
let rec insertion_point2 pos ~ text = let pos ' = ref ( pos - 1 ) in while is_space text . [ ! pos ' ] do decr pos ' done ; if text . [ ! pos ' ] = ' ( ' then insertion_point2 ! pos ' ~ text else if ! pos ' >= 5 && String . sub text ~ pos ( :! pos ' - 4 ) ~ len : 5 = " begin " && not ( is_alphanum text . [ ! pos ' - 5 ...
let rec insert_labels ~ labels ~ text expr = match labels , expr . pexp_desc with l :: labels , Pexp_function ( l ' , _ , [ pat , rem ] ) -> if l <> " " && l . [ 0 ] <> ' ' ? && l ' = " " then begin let start_c = pat . ppat_loc . Location . loc_start . Lexing . pos_cnum in let pos = insertion_point start_c ~ text in ma...
let rec insert_labels_class ~ labels ~ text expr = match labels , expr . pcl_desc with l :: labels , Pcl_fun ( l ' , _ , pat , rem ) -> if l <> " " && l . [ 0 ] <> ' ' ? && l ' = " " then begin let start_c = pat . ppat_loc . Location . loc_start . Lexing . pos_cnum in let pos = insertion_point start_c ~ text in match p...
let rec insert_labels_type ~ labels ~ text ty = match labels , ty . ptyp_desc with l :: labels , Ptyp_arrow ( l ' , _ , rem ) -> if l <> " " && l . [ 0 ] <> ' ' ? && l ' = " " then begin let start_c = ty . ptyp_loc . Location . loc_start . Lexing . pos_cnum in let pos = insertion_point start_c ~ text in add_insertion p...
let rec insert_labels_app ~ labels ~ text args = match labels , args with l :: labels , ( l ' , arg ) :: args -> if l <> " " && l . [ 0 ] <> ' ' ? && l ' = " " then begin let pos0 = arg . pexp_loc . Location . loc_start . Lexing . pos_cnum in let pos = insertion_point pos0 ~ text in match arg . pexp_desc with | Pexp_id...
let insert_labels_app ~ labels ~ text args = let labels , opt_labels = List . partition labels ~ f ( : fun l -> l = " " || l . [ 0 ] <> ' ' ) ? in let nopt_labels = List . map opt_labels ~ f ( : fun l -> String . sub l ~ pos : 1 ~ len ( : String . length l - 1 ) ) in if List . exists labels ~ f ( : List . mem ~ set : n...
let rec add_labels_expr ~ text ~ values ~ classes expr = let add_labels_rec ( ? values = values ) expr = add_labels_expr ~ text ~ values ~ classes expr in match expr . pexp_desc with Pexp_apply ( { pexp_desc = Pexp_ident ( Longident . Lident s ) } , args ) -> begin try let labels = SMap . find s values in insert_labels...
let rec add_labels_class ~ text ~ classes ~ values ~ methods cl = match cl . pcl_desc with Pcl_constr _ -> ( ) | Pcl_structure ( p , l ) -> let values = SMap . removes ( pattern_vars p ) values in let values = match pattern_name p with None -> values | Some s -> List . fold_left methods ~ init ( : SMap . add s [ " < ob...
let add_labels ~ intf ~ impl ~ file = insertions := [ ] ; let values , classes = List . fold_left intf ~ init ( : SMap . empty , SMap . empty ) ~ f : begin fun ( values , classes as acc ) item -> match item . psig_desc with Psig_value ( name , { pval_type = sty } ) -> ( SMap . add name ( labels_of_sty sty ) values , cl...
let process_file file = prerr_endline ( " Processing " ^ file ) ; if Filename . check_suffix file " . ml " then let intf = Filename . chop_suffix file " . ml " ^ " . mli " in let ic = open_in intf in let lexbuf = Lexing . from_channel ic in Location . init lexbuf intf ; let intf = Parse . interface lexbuf in close_in i...
let main ( ) = let files = ref [ ] in Arg . parse [ " - norec " , Arg . Set norec , " do not labelize recursive calls " ] ( fun f -> files := f :: ! files ) " addlabels [ - norec ] < files " ; > let files = List . rev ! files in List . iter files ~ f : process_file
let ( ) = main ( )
let size t = Dwarf_value . size ( Dwarf_value . uleb128 ( Uint64 . of_nonnegative_int64_exn t ) )
let emit ~ asm_directives ? comment t = Dwarf_value . emit ~ asm_directives ( Dwarf_value . uleb128 ? comment ( Uint64 . of_nonnegative_int64_exn t ) ) type nonrec t = t let compare = Stdlib . compare let hash = Hashtbl . hash let equal t1 t2 = compare t1 t2 = 0 let print ppf t = Format . fprintf ppf " % Ld " t let out...
module Pair = struct type nonrec t = t * t include Identifiable . Make ( struct type nonrec t = t let compare = Stdlib . compare let hash = Hashtbl . hash let equal t1 t2 = compare t1 t2 = 0 let print ppf ( x , y ) = Format . fprintf ppf " ( % Ld , % Ld ) " x y let output _ _ = Misc . fatal_error " Not yet implemented ...
module Entry = struct type t = { addr : Asm_label . t ; adjustment : int } include Identifiable . Make ( struct type nonrec t = t let compare { addr = addr1 ; adjustment = adjustment1 } { addr = addr2 ; adjustment = adjustment2 } = let c = Asm_label . compare addr1 addr2 in if c <> 0 then c else Stdlib . compare adjust...
type entry_and_soc_symbol = { entry : Entry . t ; start_of_code_symbol : Asm_symbol . t }
type t = { base_addr : Asm_label . t ; mutable next_index : Address_index . t ; mutable table : entry_and_soc_symbol Address_index . Map . t ; mutable rev_table : Address_index . t Entry . Map . t }
let create ( ) = { base_addr = Asm_label . create ( DWARF Debug_addr ) ; next_index = Address_index . zero ; table = Address_index . Map . empty ; rev_table = Entry . Map . empty }
let add ( ? adjustment = 0 ) t ~ start_of_code_symbol addr = let entry : Entry . t = { addr ; adjustment } in match Entry . Map . find entry t . rev_table with | exception Not_found -> let index = t . next_index in t . next_index <- Address_index . succ index ; t . rev_table <- Entry . Map . add entry index t . rev_tab...
let base_addr t = t . base_addr
let initial_length t = let num_entries = Int64 . of_int ( Address_index . Map . cardinal t . table ) in let size_entries = Int64 . mul num_entries ( Int64 . of_int Dwarf_arch_sizes . size_addr ) in Initial_length . create ( Dwarf_int . of_int64_exn ( Int64 . add 4L size_entries ) )
let size t = let initial_length = initial_length t in Dwarf_int . add ( Initial_length . size initial_length ) ( Initial_length . to_dwarf_int initial_length )
let entry_to_dwarf_value ( entry : entry_and_soc_symbol ) = let adjustment = Targetint . of_int_exn entry . entry . adjustment in Dwarf_value . code_address_from_label_symbol_diff ~ comment " : ending address " ~ upper : entry . entry . addr ~ lower : entry . start_of_code_symbol ~ offset_upper : adjustment ( )
let emit ~ asm_directives t = let module A = ( val asm_directives : Asm_directives . S ) in Initial_length . emit ~ asm_directives ( initial_length t ) ; Dwarf_version . emit ~ asm_directives Dwarf_version . five ; A . uint8 ( Uint8 . of_nonnegative_int_exn Dwarf_arch_sizes . size_addr ) ; A . uint8 Uint8 . zero ; A . ...
let afl_area_ptr dbg = Cconst_symbol ( " caml_afl_area_ptr " , dbg )
let afl_prev_loc dbg = Cconst_symbol ( " caml_afl_prev_loc " , dbg )
let afl_map_size = 1 lsl 16
let rec with_afl_logging b dbg = if ! Clflags . afl_inst_ratio < 100 && Random . int 100 >= ! Clflags . afl_inst_ratio then instrument b else let instrumentation = let cur_location = Random . int afl_map_size in let cur_pos = V . create_local " pos " in let afl_area = V . create_local " shared_mem " in let op oper args...
let instrument_function c dbg = with_afl_logging c dbg
let instrument_initialiser c dbg = with_afl_logging ( Csequence ( Cop ( Cextcall ( " caml_setup_afl " , typ_int , [ ] , false ) , [ Cconst_int ( 0 , dbg ( ) ) ] , dbg ( ) ) , c ) ) ( dbg ( ) )
let total = ref 0
let err = ref 0
let res = Hashtbl . create 256
let print_title title = print_string " \ x1b [ 1 ; 37m " ; print_endline title ; print_endline ( String . make ( String . length title ) ' ' ) ; ~ print_endline " \ x1b [ 0m "
let rec update file form value = try let line = input_line file in if String . length line > 2 && not ( Hashtbl . mem res line ) then if line . [ 0 ] = ' . ' && line . [ 1 ] <> ' ' > && not ( Hashtbl . mem res line ) then Hashtbl . add res line true else if line . [ 0 ] = ' \ x1b ' && not ( Hashtbl . mem res line ) the...
let rec process n = if n = 0 then ( ) else begin let file = open_in Sys . argv . ( n ) in print_title ( Filename . chop_extension Sys . argv . ( n ) ) ; update file " Total : \ x1b [ 0 ; % dm % d % s " total ; update file " Failed : \ x1b [ 0 ; % dm % d % s " err ; begin try print_endline ( input_line file ) ; print_en...
let print_res title total err = print_title title ; print_string " Total : \ x1b [ 0 ; 34m " ; print_int total ; print_string " \ x1b [ 0m \ nFailed : \ x1b [ 0 ; 31m " ; print_int err ; let ratio = ( . - ) 100 . @@ ( . * ) 100 . @@ ( float_of_int total |> ( . / ) @@ float_of_int err ) in print_string @@ " \ x1b [ 0m \...
let ( ) = process ( Array . length Sys . argv - 1 ) ; print_endline " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \ n \ n \ x1b [ 1 ; 37m " ; print_endline " " ; ~~~~~~~~~~~~~~~~~~~~~~ print_endline " | " ; | print_endline " +- Summed Results " ; -+ print_res " | " | ! ...
let compose_map_values_exn map ~ then_ : coercion = if Coercion . is_id coercion then map else Name . Map . map_sharing ( fun old_coercion -> Coercion . compose_exn old_coercion ~ then_ : coercion ) map
module Map_to_canonical = struct type t = coercion_to_canonical Name . Map . t let fatal_inconsistent ~ func_name elt coercion1 coercion2 = Misc . fatal_errorf " [ % s ] maps with inconsistent element / coercion couples ; % a has coercions \ % a and % a " func_name Name . print elt Coercion . print coercion1 Coercion ....
module Aliases_of_canonical_element : sig type t val print : Format . formatter -> t -> unit val invariant : t -> unit val empty : t val is_empty : t -> bool val add : t -> Name . t -> coercion_to_canonical : coercion_to_canonical -> Name_mode . t -> t val find_earliest_candidates : t -> filter_by_scope ( : Name_mode ....
module Alias_set = struct type t = { const : Reg_width_const . t option ; names : Coercion . t Name . Map . t } let empty = { const = None ; names = Name . Map . empty } let create_aliases_of_element ~ element : _ ~ canonical_element ~ coercion_from_canonical_to_element ~ alias_names_with_coercions_to_element = Simple ...
type t = { canonical_elements : ( Simple . t * coercion_to_canonical ) Name . Map . t ; aliases_of_canonical_names : Aliases_of_canonical_element . t Name . Map . t ; aliases_of_consts : Aliases_of_canonical_element . t Reg_width_const . Map . t }
let [ @ ocamlformat " disable " ] print ppf { canonical_elements ; aliases_of_canonical_names ; aliases_of_consts ; } = let print_element_and_coercion ppf ( elt , coercion ) = Format . fprintf ppf " [ @< hov 1 ( >\ % a @ \ [ @< hov 1 >@< 0 >% s ( coercion @ % a ) @< 0 >% s ] @\ ) ] " @ Simple . print elt ( if Coercion ...
let name_defined_earlier ~ binding_time_resolver ~ binding_times_and_modes alias ~ than = if Name . equal alias than || ( Name . is_symbol alias && Name . is_symbol than ) then false else if Name . is_symbol alias && not ( Name . is_symbol than ) then true else if Name . is_symbol than && not ( Name . is_symbol alias )...
let defined_earlier ~ binding_time_resolver ~ binding_times_and_modes alias ~ than = Simple . pattern_match than ~ const ( : fun _ -> false ) ~ name ( : fun than ~ coercion : _ -> Simple . pattern_match alias ~ const ( : fun _ -> true ) ~ name ( : fun alias ~ coercion : _ -> name_defined_earlier ~ binding_time_resolver...
let binding_time_and_name_mode ~ binding_times_and_modes elt = Simple . pattern_match ' elt ~ const ( : fun _ -> Binding_time . With_name_mode . consts ) ~ var ( : fun var ~ coercion : _ -> let name = Name . var var in match Name . Map . find name binding_times_and_modes with | _ , binding_time_and_mode -> binding_time...
let compute_name_mode_unscoped ~ binding_times_and_modes elt = Binding_time . With_name_mode . name_mode ( binding_time_and_name_mode ~ binding_times_and_modes elt )
let compute_name_mode ~ binding_times_and_modes elt ~ min_binding_time = Binding_time . With_name_mode . scoped_name_mode ( binding_time_and_name_mode ~ binding_times_and_modes elt ) ~ min_binding_time
let invariant ~ binding_time_resolver ~ binding_times_and_modes t = if Flambda_features . check_invariants ( ) then let all_aliases_of_names : Map_to_canonical . t = Name . Map . fold ( fun canonical_element aliases all_aliases -> Aliases_of_canonical_element . invariant aliases ; let aliases = Aliases_of_canonical_ele...
let empty = { canonical_elements = Name . Map . empty ; aliases_of_canonical_names = Name . Map . empty ; aliases_of_consts = Reg_width_const . Map . empty }
type canonical = | Is_canonical | Alias_of_canonical of { canonical_element : Simple . t ; coercion_to_canonical : coercion_to_canonical }
let canonical t element : canonical = Simple . pattern_match element ~ const ( : fun _ -> Is_canonical ) ~ name ( : fun name ~ coercion : coercion_from_bare_element_to_element -> match Name . Map . find name t . canonical_elements with | exception Not_found -> Is_canonical | canonical_element , coercion_from_bare_eleme...
let get_aliases_of_canonical_element t ~ canonical_element = assert ( not ( Simple . has_coercion canonical_element ) ) ; let name name ~ coercion : _ = Name . Map . find name t . aliases_of_canonical_names in let const const = Reg_width_const . Map . find const t . aliases_of_consts in match Simple . pattern_match can...
let add_alias_between_canonical_elements ~ binding_time_resolver ~ binding_times_and_modes t ~ canonical_element ~ coercion_to_canonical ~ to_be_demoted = if Simple . equal canonical_element to_be_demoted then if Coercion . is_id coercion_to_canonical then t else Misc . fatal_errorf " Cannot add an alias of % a @ to it...
type to_be_demoted = | Demote_canonical_element1 | Demote_canonical_element2
let choose_canonical_element_to_be_demoted ~ binding_time_resolver ~ binding_times_and_modes ~ canonical_element1 ~ canonical_element2 = if defined_earlier ~ binding_time_resolver ~ binding_times_and_modes canonical_element1 ~ than : canonical_element2 then Demote_canonical_element2 else Demote_canonical_element1
type add_result = { t : t ; canonical_element : Simple . t ; alias_of_demoted_element : Simple . t }
let invariant_add_result ~ binding_time_resolver ~ binding_times_and_modes ~ original_t { canonical_element ; alias_of_demoted_element ; t } = if Flambda_features . check_invariants ( ) then begin invariant ~ binding_time_resolver ~ binding_times_and_modes t ; if not ( defined_earlier ~ binding_time_resolver ~ binding_...
let add_alias ~ binding_time_resolver ~ binding_times_and_modes t ~ canonical_element1 ~ coercion_from_canonical_element2_to_canonical_element1 ~ canonical_element2 = assert ( not ( Simple . has_coercion canonical_element1 ) ) ; assert ( not ( Simple . has_coercion canonical_element2 ) ) ; let ( canonical_element , dem...
let add ~ binding_time_resolver ~ binding_times_and_modes t ~ canonical_element1 : element1_with_coercion ~ canonical_element2 : element2_with_coercion = let original_t = t in let canonical_element1 = element1_with_coercion |> Simple . without_coercion in let canonical_element2 = element2_with_coercion |> Simple . with...
let find_earliest_alias t ~ canonical_element ~ binding_times_and_modes ~ min_binding_time ~ min_name_mode ~ binding_time_resolver ~ coercion_from_canonical_to_element = let aliases = get_aliases_of_canonical_element t ~ canonical_element in let filter_by_scope name_mode names = if Name_mode . equal name_mode Name_mode...
let get_canonical_element_exn ~ binding_time_resolver ~ binding_times_and_modes t element elt_name_mode ~ min_name_mode ~ min_binding_time = let canonical = canonical t element in match canonical with | Is_canonical when match Name_mode . compare_partial_order elt_name_mode min_name_mode with | None -> false | Some c -...
let get_aliases t element = match canonical t element with | Is_canonical -> let canonical_element = Simple . without_coercion element in assert ( not ( Simple . has_coercion canonical_element ) ) ; let alias_names_with_coercions_to_canonical = Aliases_of_canonical_element . all ( get_aliases_of_canonical_element t ~ c...
let all_ids_for_export { canonical_elements ; aliases_of_canonical_names ; aliases_of_consts } = let ids = Name . Map . fold ( fun elt ( canonical , coercion ) ids -> let ids = Ids_for_export . union ids ( Coercion . all_ids_for_export coercion ) in Ids_for_export . add_name ( Ids_for_export . add_simple ids canonical ...
let apply_renaming { canonical_elements ; aliases_of_canonical_names ; aliases_of_consts } renaming = let rename_name = Renaming . apply_name renaming in let rename_simple = Renaming . apply_simple renaming in let canonical_elements = Name . Map . fold ( fun elt ( canonical , coercion ) acc -> Name . Map . add ( rename...
let merge t1 t2 = let canonical_elements = Name . Map . disjoint_union t1 . canonical_elements t2 . canonical_elements in ( if Flambda_features . check_invariants ( ) then let empty_maps = Name . Map . is_empty t1 . aliases_of_canonical_names && Reg_width_const . Map . is_empty t1 . aliases_of_consts && Name . Map . is...
let get_canonical_ignoring_name_mode t name = let elt = Simple . name name in match canonical t elt with | Is_canonical -> elt | Alias_of_canonical { canonical_element ; coercion_to_canonical } -> let coercion_from_canonical = Coercion . inverse coercion_to_canonical in Simple . apply_coercion_exn canonical_element coe...
let clean_for_export { canonical_elements ; aliases_of_canonical_names = _ ; aliases_of_consts = _ } ~ reachable_names = let canonical_elements = Name . Map . filter ( fun name _canonical_and_coercion_to_canonical -> ( not ( Name . is_imported name ) ) && Name_occurrences . mem_name reachable_names name ) canonical_ele...
type allocation_point = | Symbol of Symbol . t | Variable of Variable . t
type allocated_const = | Normal of Allocated_const . t | Array of Lambda . array_kind * Lambda . mutable_flag * Variable . t list | Duplicate_array of Lambda . array_kind * Lambda . mutable_flag * Variable . t
type constant_defining_value = | Allocated_const of allocated_const | Block of Tag . t * Variable . t list | Set_of_closures of Flambda . set_of_closures | Project_closure of Flambda . project_closure | Move_within_set_of_closures of Flambda . move_within_set_of_closures | Project_var of Flambda . project_var | Field o...
type initialize_symbol_field = Variable . t option
type definitions = { variable : constant_defining_value Variable . Tbl . t ; initialize_symbol : initialize_symbol_field list Symbol . Tbl . t ; symbol : Flambda . constant_defining_value Symbol . Tbl . t ; }
let print_constant_defining_value ppf = function | Allocated_const ( Normal const ) -> Allocated_const . print ppf const | Allocated_const ( Array ( _ , _ , vars ) ) -> Format . fprintf ppf " [ | % a ] " | ( Format . pp_print_list Variable . print ) vars | Allocated_const ( Duplicate_array ( _ , _ , var ) ) -> Format ....
let rec resolve_definition ( definitions : definitions ) ( var : Variable . t ) ( def : constant_defining_value ) ~ the_dead_constant : allocation_point = match def with | Allocated_const _ | Block _ | Set_of_closures _ | Project_closure _ | Const _ | Move_within_set_of_closures _ -> Variable var | Project_var { var } ...
let run variable initialize_symbol symbol ~ the_dead_constant = let definitions = { variable ; initialize_symbol ; symbol ; } in Variable . Tbl . fold ( fun var definition result -> let definition = resolve_definition definitions var definition ~ the_dead_constant in Variable . Map . add var definition result ) definit...
let ar = Array . create l " " ; ;
let compact_flag = ref false ; ;
let main ( ) = while true do for i = 1 to 100000 do ar . ( Random . int l ) <- String . create ( Random . int m ) ; done ; if ! compact_flag then Gc . compact ( ) else Gc . full_major ( ) ; print_newline ( ) ; Gc . print_stat stdout ; flush stdout ; done ; ;
let argspecs = [ " - c " , Arg . Set compact_flag , " do heap compactions " ; ] ; ;
type t = | Float of float | Int32 of int32 | Int64 of int64 | Nativeint of nativeint | Float_array of float list | Immutable_float_array of float list | String of string | Immutable_string of string
let compare_floats x1 x2 = Int64 . compare ( Int64 . bits_of_float x1 ) ( Int64 . bits_of_float x2 )
let compare ( x : t ) ( y : t ) = let rec compare_float_lists l1 l2 = match l1 , l2 with | [ ] , [ ] -> 0 | [ ] , _ :: _ -> - 1 | _ :: _ , [ ] -> 1 | h1 :: t1 , h2 :: t2 -> let c = compare_floats h1 h2 in if c <> 0 then c else compare_float_lists t1 t2 in match x , y with | Float x , Float y -> compare_floats x y | Int...
let print ppf ( t : t ) = let fprintf = Format . fprintf in let floats ppf fl = List . iter ( fun f -> fprintf ppf " @ % f " f ) fl in match t with | String s -> fprintf ppf " % S " s | Immutable_string s -> fprintf ppf " #% S " s | Int32 n -> fprintf ppf " % lil " n | Int64 n -> fprintf ppf " % LiL " n | Nativeint n -...
let twopi = 2 . 0 . * pic
let test_loops = 5 [ | 0 . 3870983098 ; 0 . 0 ; 0 . 0 ] ; | [ | 0 . 7233298200 ; 0 . 0 ; 0 . 0 ] ; | [ | 1 . 0000010178 ; 0 . 0 ; 0 . 0 ] ; | [ | 1 . 5236793419 ; 3e - 10 ; 0 . 0 ] ; | [ | 5 . 2026032092 ; 19132e - 10 ; - 39e - 10 ] ; | [ | 9 . 5549091915 ; - 0 . 0000213896 ; 444e - 10 ] ; | [ | 19 . 2184460618 ; - 371...
let anpm a = let w = mod_float a twopi in if abs_float w >= pic then begin if a < 0 . 0 then else end else w
let planetpv epoch np pv = let t = ( ( epoch . ( 0 ) . - j2000 ) . + epoch . ( 1 ) ) . / jmillenia in let da = ref ( a . ( np ) . ( 0 ) . + ( a . ( np ) . ( 1 ) . + a . ( np ) . ( 2 ) . * t ) . * t ) and dl = ref ( ( 3600 . 0 . * dlm . ( np ) . ( 0 ) . + ( dlm . ( np ) . ( 1 ) . + dlm . ( np ) . ( 2 ) . * t ) . * t ) ....
let radecdist state rdd = rdd . ( 2 ) <- sqrt ( state . ( 0 ) . ( 0 ) . * state . ( 0 ) . ( 0 ) rdd . ( 0 ) <- atan2 state . ( 0 ) . ( 1 ) state . ( 0 ) . ( 0 ) . * r2h ; if rdd . ( 0 ) < 0 . 0 then rdd . ( 0 ) <- rdd . ( 0 ) . + 24 . 0 ; rdd . ( 1 ) <- asin ( state . ( 0 ) . ( 2 ) . / rdd . ( 2 ) ) . * r2d
let _ = let jd = [ | 0 . 0 ; 0 . 0 ] | and pv = [ | [ | 0 . 0 ; 0 . 0 ; 0 . 0 ] ; | [ | 0 . 0 ; 0 . 0 ; 0 . 0 ] | ] | and position = [ | 0 . 0 ; 0 . 0 ; 0 . 0 ] | in jd . ( 0 ) <- j2000 ; jd . ( 1 ) <- 1 . 0 ; for p = 0 to 7 do planetpv jd p pv ; radecdist pv position ; Printf . printf " % d . % 2f . % 2f \ n " %! p po...
let ( ==: ) = Signal . ( ==: )