Module Computor.Pp

This file will contain all pretty-printing for computorv1

val deltap : Stdlib.Format.formatter -> float -> unit

deltap fmt delta takes the delta of a given equation and based on its sign, prints the corresponding string

val pow : Stdlib.Format.formatter -> int -> unit

pow fmt n takes in a power and pretty-prints it

val var : Stdlib.Format.formatter -> (string * int) option -> unit

var fmt (var, n) takes in the optionnal part of a monome and prints it if needed

val mono : Stdlib.Format.formatter -> Ast.monome -> unit

mono fmt (coef, var) successively prints each element of the monome list

val polyprint : Stdlib.Format.formatter -> ((int * float) list * string) -> unit

polyprint fmt (terms, variable) takes a list of terms (power:int * coefficient:float) and the only variable present in the polynome and takes care of the pretty-printing

val equ : Stdlib.Format.formatter -> ((int * float) list * (int * float) list * string) -> unit

equ fmt (polynome_l, polynome_r, var) takes both sides of the equation as polynomes of type (int * float) list as well as the only variable present in the equation. The polynome is represented as such instead of a Ast.monome list because of the simplification undertaken in the Hashtable of type (power:int coefficient:float). Sending an empty list will simply print 0, once again this obeys the printing specifications of the ComputorV1 42 subject