Cassowary Constraint Solver
   HOME

TheInfoList



OR:

Cassowary is an incremental
constraint solving Constraint may refer to: * Constraint (computer-aided design), a demarcation of geometrical characteristics between two or more entities or solid modeling bodies * Constraint (mathematics), a condition of an optimization problem that the solution m ...
toolkit that efficiently solves systems of linear equalities and
inequalities Inequality may refer to: Economics * Attention inequality, unequal distribution of attention across users, groups of people, issues in etc. in attention economy * Economic inequality, difference in economic well-being between population groups * ...
. Constraints may be either requirements or preferences. Client code specifies the constraints to be maintained, and the solver updates the constrained variables to have values that satisfy the constraints. Cassowary was developed by Greg J. Badros, Alan Borning and Peter J. Stuckey, and was optimized for user interface applications. Badros used Cassowary amongst others for implementing Constraint Cascading Style Sheets (CCSS), an extension to
Cascading Style Sheets Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document written in a markup language such as HTML or XML (including XML dialects such as SVG, MathML or XHTML). CSS is a cornerstone techno ...
(CSS). CCSS adds support for
layout Layout may refer to: * Page layout, the arrangement of visual elements on a page ** Comprehensive layout (comp), a proposed page layout presented by a designer to their client * Layout (computing), the process of calculating the position of obje ...
constraints. These allow
designers A designer is a person who plans the form or structure of something before it is made, by preparing drawings or plans. In practice, anyone who creates tangible or intangible objects, products, processes, laws, games, graphics, services, or exp ...
to describe the layout of a web page in a more flexible manner. Cassowary is used to solve these constraints and calculate the final layout. The original distribution, unmaintained since 2000, included
Smalltalk Smalltalk is an object-oriented, dynamically typed reflective programming language. It was designed and created in part for educational use, specifically for constructionist learning, at the Learning Research Group (LRG) of Xerox PARC by Alan Ka ...
,
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
and
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
implementations, along with bindings for
GNU Guile GNU Ubiquitous Intelligent Language for Extensions (GNU Guile) is the preferred extension language system for the GNU Project and features an implementation of the programming language Scheme. Its first version was released in 1993. In addition ...
,
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
, and STk. Third-party implementations exist for
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
,
Dart Dart or DART may refer to: * Dart, the equipment in the game of darts Arts, entertainment and media * Dart (comics), an Image Comics superhero * Dart, a character from ''G.I. Joe'' * Dart, a ''Thomas & Friends'' railway engine character * Dar ...
,
Squeak Squeak is an object-oriented, class-based, and reflective programming language. It was derived from Smalltalk-80 by a group that included some of Smalltalk-80's original developers, initially at Apple Computer, then at Walt Disney Imagineering, ...
,
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
, the
.NET Framework The .NET Framework (pronounced as "''dot net"'') is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure (CLI) until bein ...
, and
Rust Rust is an iron oxide, a usually reddish-brown oxide formed by the reaction of iron and oxygen in the catalytic presence of water or air moisture. Rust consists of hydrous iron(III) oxides (Fe2O3·nH2O) and iron(III) oxide-hydroxide (FeO(OH ...
.


Applications

* As of September 2014, GSS, a layout language and layout engine for the web, is being developed by The Grid. It is a modern extension of CCSS. * Layx, a layout language for the web designed with ease of use in mind. *
Scwm Scwm or Scheme Constraints Window Manager is a window manager for the X Window System. Its main features are dynamic configurability and programmability via a language based on GNU Guile and the embedded arithmetic Cassowary constraint solver. Th ...
, the Scheme Constraints Window Manager. * As of 2011, Cassowary is being used as the algorithm in the layout engine for
Mac OS X macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac (computer), Mac computers. Within the market of ...
(Lion and greater) and
iOS iOS (formerly iPhone OS) is a mobile operating system created and developed by Apple Inc. exclusively for its hardware. It is the operating system that powers many of the company's mobile devices, including the iPhone; the term also includes ...
(6 and greater). * Enaml's layout engine is built on top of the Cassowary linear constraint optimizer.


References

{{Reflist, 30em, refs= The Cassowary linear arithmetic constraint solving algorithm
Authors: Greg J. Badros, Alan Borning & Peter J. Stuckey
{{Citation, title=google/cassowary.dart, date=2020-08-12, url=https://github.com/google/cassowary.dart, publisher=Google, access-date=2020-12-08 {{cite web , url=http://jovermeulen.com/Software/CassowaryNet?from=Software.Software , title=Cassowary.Net , last=Vermeulen , first=Jo , website=jovermeulen.com , access-date=December 10, 2020 {{cite web, url=https://github.com/gss/engine/network , title=Grid Style Sheets development history {{cite web , url=http://gridstylesheets.org/guides/ccss/ , title=About CCSS , access-date=2014-09-22 , archive-url=https://web.archive.org/web/20140911231410/http://gridstylesheets.org/guides/ccss/ , archive-date=2014-09-11 , url-status=dead {{cite web, url=http://www.layx.org/ , title=Layx website's homepage {{Cite web , url=https://nucleic.github.io/enaml/docs/get_started/installation.html#casuarius , title=Casuarius provides Python bindings to a C++ implementation of the Cassowary algorithm. , access-date=2017-09-19 , archive-url=https://web.archive.org/web/20170814083841/http://nucleic.github.io/enaml/docs/get_started/installation.html#casuarius , archive-date=2017-08-14 , url-status=dead Kiwi
a replacement for Casuarius/Cassowary. ''The new solver removes that bottleneck. It still uses the same Cassowary algorithm, but it's a from-scratch implementation of the algorithm based on the Cassowary paper, not the existing Cassowary source code. While the Cassowary algorithm is good, the existing C++ implementation has many inefficiencies. The new solver is anywhere between 12x and 500x faster depending on the problem (40x typical) and uses around 5x less memory. And as I typically do, I chose to write the Python bindings by hand in C++ rather than use Cython. The resulting code is faster, and we now have one less external dependency.''
{{cite web , url=https://www.cs.washington.edu/research/constraints/cassowary/ , title=Cassowary Constraint Solving Toolkit , publisher=University of Washington
/ref> C++ libraries Java (programming language) libraries Cascading Style Sheets Constraint programming