summaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorLiliana Marie Prikler <liliana.prikler@gmail.com>2022-12-08 09:49:07 +0100
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2022-12-15 16:55:51 +0100
commit4f94156452f8c9292c802686f099c2830a205312 (patch)
tree7245189dc87725b7f75d2a6c7f5e00331f7c9073 /gnu/packages/patches
parent1339623a42174c7cdfea07dc796908fae5ad047f (diff)
gnu: Add python-telingo.
* gnu/packages/patches/python-telingo-fix-comparison.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/maths.scm (python-telingo): New variable.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/python-telingo-fix-comparison.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/gnu/packages/patches/python-telingo-fix-comparison.patch b/gnu/packages/patches/python-telingo-fix-comparison.patch
new file mode 100644
index 0000000000..6d05048dcb
--- /dev/null
+++ b/gnu/packages/patches/python-telingo-fix-comparison.patch
@@ -0,0 +1,19 @@
+Index: source/telingo/transformers/head.py
+===================================================================
+--- source.orig/telingo/transformers/head.py
++++ source/telingo/transformers/head.py
+@@ -564,10 +564,12 @@ class HeadTransformer:
+ cond = []
+ diff = _ast.BinaryOperation(loc, _ast.BinaryOperator.Minus, param, shift)
+ if lhs.ast_type != _ast.ASTType.SymbolicTerm or lhs.symbol.type != _clingo.SymbolType.Number or lhs.symbol.number > 0:
+- cond.append(_ast.Literal(loc, _ast.Sign.NoSign, _ast.Comparison(_ast.ComparisonOperator.LessEqual, lhs, diff)))
++ cond.append(_ast.Literal(loc, _ast.Sign.NoSign,
++ _ast.Comparison(lhs, [_ast.Guard(_ast.ComparisonOperator.LessEqual, diff)])))
+
+ if rhs.ast_type != _ast.ASTType.SymbolicTerm or rhs.symbol.type != _clingo.SymbolType.Supremum:
+- cond.append(_ast.Literal(loc, _ast.Sign.NoSign, _ast.Comparison(_ast.ComparisonOperator.LessEqual, diff, rhs)))
++ cond.append(_ast.Literal(loc, _ast.Sign.NoSign,
++ _ast.Comparison(diff, [_ast.Guard(_ast.ComparisonOperator.LessEqual, rhs)])))
+
+ elems.extend([_ast.ConditionalLiteral(loc, _ast.Literal(loc, _ast.Sign.NoSign, head), cond) for head in heads])
+