# implies

Tags:

Updated:

implies is used to define implications between logic cases

### Syntax

F = implies(A,B)


### Examples

implies is used to define logic implications. As an example, the following code will ensure that a variable x satisfies a set of linear inequalities if a binary variable d is true. If d is false, the value of x is arbitrary the constraints could be satisfied, but they do not have to be)

d = binvar(1);
F = implies(d,A*x <= b);


implies is mainly intended for (BINARY -> BINARY) or (BINARY -> Linear constraint), although it can be used also for more general constructions such as (Linear Constraint -> Linear Constraint) (bearing in mind that these models typically are numerically sensitive and may require a lot of binary variables to be modeled).

The following code reverts the logic: if a set of linear inequalities are satisfied, the binary variable is forced to be true.

d = binvar(1);
F = implies(A*x <= b, d);


For more examples, check out another logic programming example
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5272096991539001, "perplexity": 1037.727991336291}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-29/segments/1593655892516.24/warc/CC-MAIN-20200707111607-20200707141607-00568.warc.gz"}