Closed jstolarek closed 7 years ago
Reported example now pretty prints as:
Running ../../examples/gauss.tml
val it = let n = 4 in
let as = _ in
_ ;;
_ ;;
_ ;;
_ ;;
_ ;;
_ ;;
_ ;;
_ ;;
_ ;;
_ ;;
_ ;;
_ ;;
_ ;;
_ ;;
_ ;;
_ ;;
_ ;;
_ ;;
_ ;;
_ ;;
let bs = _ in
_ ;;
_ ;;
_ ;;
_ ;;
let as' = array(n, _) in
set(as', 0, array(n, _)) ;;
set(as', 1, array(n, _)) ;;
set(as', 2, array(n, _)) ;;
_ ;;
set(get(as', 0), 0, 3.0) ;;
set(get(as', 0), 1, -1.0) ;;
_ ;;
_ ;;
set(get(as', 1), 0, 3.0) ;;
set(get(as', 1), 1, -1.0) ;;
_ ;;
_ ;;
set(get(as', 2), 0, 1.0) ;;
set(get(as', 2), 1, 2.0) ;;
_ ;;
_ ;;
_ ;;
_ ;;
_ ;;
_ ;;
let bs' = _ in
_ ;;
_ ;;
_ ;;
_ ;;
let gauss = (fun gauss a b =>
let dia = ref 0 in
(while !dia < n do
let row = ref (!dia + 1) in
(while !row < n do
let tmp = (get(get(a, !row), !dia)) / (get(get(a, !dia), !dia)) in
let col = ref (!dia + 1) in
(while !col < n do
let x = get(get(a, !row), !col) in
set(get(a, !row), !col, x - (tmp * (get(get(a, !dia), !col)))) ;;
_)
;;
_ ;;
let b_row = _ in
_ ;; row := !row + 1)
;; dia := !dia + 1)
;; _) in
map (fun f x => gauss fst x _) Cons (_, Cons ((as', _), _)) : trace(reslist)
This is looking pretty nice ;)
On 20 March 2017 at 17:45, Jan Stolarek notifications@github.com wrote:
Reported example now pretty prints as:
Running ../../examples/gauss.tml val it = let n = 4 in let as = in ;; ;; ;; ;; ;; ;; ;; ;; ;; ;; ;; ;; ;; ;; ;; ;; ;; ;; ;; ;; let bs = in ;; ;; ;; ;; let as' = array(n, ) in set(as', 0, array(n, )) ;; set(as', 1, array(n, )) ;; set(as', 2, array(n, )) ;; ;; set(get(as', 0), 0, 3.0) ;; set(get(as', 0), 1, -1.0) ;; ;; ;; set(get(as', 1), 0, 3.0) ;; set(get(as', 1), 1, -1.0) ;; ;; ;; set(get(as', 2), 0, 1.0) ;; set(get(as', 2), 1, 2.0) ;; ;; ;; ;; ;; ;; ;; let bs' = in ;; ;; ;; ;; let gauss = (fun gauss a b => let dia = ref 0 in (while !dia < n do let row = ref (!dia + 1) in (while !row < n do let tmp = (get(get(a, !row), !dia)) / (get(get(a, !dia), !dia)) in let col = ref (!dia + 1) in (while !col < n do let x = get(get(a, !row), !col) in set(get(a, !row), !col, x - (tmp * (get(get(a, !dia), !col)))) ;; ) ;; ;; let brow = in ;; row := !row + 1) ;; dia := !dia + 1) ;; ) in map (fun f x => gauss fst x ) Cons (, Cons ((as', ), )) : trace(reslist)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jstolarek/slicer/issues/64#issuecomment-287840886, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHY8pFhAWrSO_gbp1LuuGXgva_EXt7Zks5rnrtXgaJpZM4MNuLJ .
Pretty-printing for larger programs is far from "pretty":
Need to do something about those indentations.