# Revision history [back]

### How to obtain all finite connected distributive lattices with SAGE

In https://ask.sagemath.org/question/38865/obtaining-all-posets-in-a-certain-form-with-sage/ I asked for a programm that translates all finite posets into a given form. Now I want to do the same with all finite connected distributive lattices instead of all connected posets.

First I wanted it with all lattices, I changed the code posets = [ p for p in Posets(n) if p.is_connected() ] into posets = [ p for p in Posets(n) if p.is_connected() and p.is_lattice]

This worked for me. But if I try to obtain now in addition all distributive lattices via the command is_distributive() (found here: http://doc.sagemath.org/html/en/reference/combinat/sage/combinat/posets/lattices.html#) I get an error when I try into posets = [ p for p in Posets(n) if p.is_connected() and p.is_lattice() and p.is_distributive()]. How to fix that?

Another question: I want to use the SAGE output of this to define a list in GAP. The problem is that I cannot directly copy paste since GAP allows me to define a list only in case the list occupies only one line. (for example [ [["x1", "x2", "x3"], [["x1", "x2"], ["x1", "x3"]] ],

[["x1", "x2", "x3"], [["x1", "x2"], ["x2", "x3"]]],

[["x1", "x2", "x3"], [["x1", "x3"], ["x2", "x3"]]]]

is not ok for GAP but [ [["x1", "x2", "x3"], [["x1", "x2"], ["x1", "x3"]] ], [["x1", "x2", "x3"], [["x1", "x2"], ["x2", "x3"]]], [["x1", "x2", "x3"], [["x1", "x3"], ["x2", "x3"]]]] is ok when it is in one line). Is there a way to obtain the SAGE output in one line or is there a textmanager that can do such a thing? (this is a problem in case the SAGE output is very long)

### How to obtain all finite connected distributive lattices with SAGE

In https://ask.sagemath.org/question/38865/obtaining-all-posets-in-a-certain-form-with-sage/ I asked for a programm that translates all finite posets into a given form. Now I want to do the same with all finite connected distributive lattices instead of all connected posets.

First I wanted it with all lattices, I changed the code posets = [ p for p in Posets(n) if p.is_connected() ] into posets = [ p for p in Posets(n) if p.is_connected() and p.is_lattice]

This worked for me. But if I try to obtain now in addition all distributive lattices via the command is_distributive() (found here: http://doc.sagemath.org/html/en/reference/combinat/sage/combinat/posets/lattices.html#) I get an error when I try into posets = [ p for p in Posets(n) if p.is_connected() and p.is_lattice() and p.is_distributive()]. How to fix that?

Another question: I want to use the SAGE output of this to define a list in GAP. The problem is that I cannot directly copy paste since GAP allows me to define a list only in case the list occupies only one line. (for example [ [["x1", "x2", "x3"], [["x1", "x2"], ["x1", "x3"]] ],

[["x1", "x2", "x3"], [["x1", "x2"], ["x2", "x3"]]],

[["x1", "x2", "x3"], [["x1", "x3"], ["x2", "x3"]]]]

is not ok for GAP but [ [["x1", "x2", "x3"], [["x1", "x2"], ["x1", "x3"]] ], [["x1", "x2", "x3"], [["x1", "x2"], ["x2", "x3"]]], [["x1", "x2", "x3"], [["x1", "x3"], ["x2", "x3"]]]] is ok when it is in one line). Is there a way to obtain the SAGE output in one line or is there a textmanager that can do such a thing? (this is a problem in case the SAGE output is very long)

edit: For my second problem I found the website https://www.textfixer.com/tools/remove-line-breaks.php to remove line breaks in text. I wonder if there is a basic way using texteditors without the internet.

### How to obtain all finite connected distributive lattices with SAGE

In https://ask.sagemath.org/question/38865/obtaining-all-posets-in-a-certain-form-with-sage/ I asked for a programm that translates all finite posets into a given form. Now I want to do the same with all finite connected distributive lattices instead of all connected posets.

First I wanted it with all lattices, I changed the code posets = [ p for p in Posets(n) if p.is_connected() ] into posets = [ p for p in Posets(n) if p.is_connected() and p.is_lattice]

This worked for me. But if I try to obtain now in addition all distributive lattices via the command is_distributive() (found here: http://doc.sagemath.org/html/en/reference/combinat/sage/combinat/posets/lattices.html#) I get an error when I try into posets = [ p for p in Posets(n) if p.is_connected() and p.is_lattice() and p.is_distributive()]. How to fix that?

And is there a way to obtain all connected finite posets with n points having a global maximum and a global minimum?

Another question: I want to use the SAGE output of this to define a list in GAP. The problem is that I cannot directly copy paste since GAP allows me to define a list only in case the list occupies only one line. (for example [ [["x1", "x2", "x3"], [["x1", "x2"], ["x1", "x3"]] ],

[["x1", "x2", "x3"], [["x1", "x2"], ["x2", "x3"]]],

[["x1", "x2", "x3"], [["x1", "x3"], ["x2", "x3"]]]]

is not ok for GAP but [ [["x1", "x2", "x3"], [["x1", "x2"], ["x1", "x3"]] ], [["x1", "x2", "x3"], [["x1", "x2"], ["x2", "x3"]]], [["x1", "x2", "x3"], [["x1", "x3"], ["x2", "x3"]]]] is ok when it is in one line). Is there a way to obtain the SAGE output in one line or is there a textmanager that can do such a thing? (this is a problem in case the SAGE output is very long)

edit: For my second problem I found the website https://www.textfixer.com/tools/remove-line-breaks.php to remove line breaks in text. I wonder if there is a basic way using texteditors without the internet.