Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove fractal displacementns #23

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions src/Shift.ml
Original file line number Diff line number Diff line change
Expand Up @@ -299,57 +299,6 @@ struct
x
end

module Fractal (Base : S) :
sig
include S
val embed : Base.t -> t
val push : Base.t -> t -> t
end
=
struct
type t = Base.t * Base.t list

let embed s : t = s, []
let push s1 (s2, s2s) = s1, (s2 :: s2s)

let id = embed Base.id

let is_id = function s, [] -> Base.is_id s | _ -> false

let equal (i1, is1) (i2, is2) =
List.equal Base.equal (i1 :: is1) (i2 :: is2)

let rec lt xs ys =
match xs, ys with
| [], [] -> false
| [], _ -> true
| _::_, [] -> false
| x::xs, y::ys -> Base.lt x y || (Base.equal x y && lt xs ys)

let lt (i1, is1) (i2, is2) = lt (i1 :: is1) (i2 :: is2)

let rec leq xs ys =
match xs, ys with
| [], _ -> true
| _::_, [] -> false
| x::xs, y::ys -> Base.lt x y || (Base.equal x y && leq xs ys)

let leq (i1, is1) (i2, is2) = leq (i1 :: is1) (i2 :: is2)

let rec compose s1 s2 =
match s1, s2 with
| (s1, []), (s2, s2s) -> Base.compose s1 s2, s2s
| (s1, (s11 :: s1s)), _ -> push s1 (compose (s11, s1s) s2)

let dump fmt (s, ss) =
if ss = [] then
Base.dump fmt s
else
Format.fprintf fmt "@[<1>(%a)@]"
(Format.pp_print_list ~pp_sep:(fun fmt () -> Format.pp_print_string fmt ")@,.(") Base.dump)
(s :: ss)
end

module Opposite (Base : S) :
sig
include S
Expand Down
13 changes: 0 additions & 13 deletions src/Shift.mli
Original file line number Diff line number Diff line change
Expand Up @@ -176,19 +176,6 @@ sig
val to_list : t -> Base.t list
end

(** Fractal displacements. *)
module Fractal (Base : S) :
sig
(** @closed *)
include S

(** [embed b] is the embedding of the base displacement [b]. *)
val embed : Base.t -> t

(** [push b s] pushes [s] to the sub-level and applies [b] to the main level. *)
val push : Base.t -> t -> t
end

(** Opposite displacements *)
module Opposite (Base : S) :
sig
Expand Down