Questions tagged [clp]

Constraint logic programming is a programming paradigm that combines features of logic programming and constraint programming. As in regular logic programming, programs are queried about the provability of a goal, which may contain constraints in addition to literals.

67 questions
0
votes
0 answers

How to debug non-termination

I'm trying to implement n_factors/2 predicate that works in all directions. :- use_module(library(clpz)). n_factors(N, Fs) :- integer(N), N > 1, primes(Ps), n_factors0(N, Fs, Ps), !. n_factors(N, Fs) :- var(N), …
vasily
  • 2,850
  • 1
  • 24
  • 40
0
votes
1 answer

SWI Prolog - CLP(R) not propagating fully

This gives me a result: ?- {5/(X) = (5/2)}. X = 2.0 ; This shows me a constraint, but doesn't let me use X in any material way: ?- {5/(3-X) = (5/2)}. {-2.5+5/(3-X)=0.0}. ?- {5/(3-X) = (5/2)}, Z is X. ERROR: Arguments are not sufficiently…
Name McChange
  • 2,750
  • 5
  • 27
  • 46
0
votes
2 answers

REST webervice running a QSHELL script

I have a REST web service running an RPG program, as I need to encrypt some data using Openssl I have built a shell script that receives the data via ENV vars and sends out the data in data areas. Rest_RPG calls a CLP that runs the qsh script, and…
0
votes
1 answer

Call sql script from another script in CLP

I'm using DB2 on Unix and I want to call a master script that run some other scripts within it. Note that I 'm using CLP. The master script would like as follow in Oracle : @@script1 @@script2 etc Is it possible to achieve this in DB2 using CLP …
Elmo N'diaye
  • 29
  • 1
  • 4
0
votes
0 answers

Timetable schedule and students allocation

I want to optimize an allocation of courses to students respecting their wishes. Every student grades all courses with numbers (eg. 1-6, more is better) 20 courses are assigned to 5 timeslots, so in each timeslot 3-6 courses are synchronous. I am…
0
votes
1 answer

Graph Coloring with CLP(FD)

I am trying to solve the map/graph coloring problem using CLP(FD) in Prolog. I took the predicates from the paper "A comparison of CLP(FD) and ASP solutions to NP-complete problems" and I'm trying with the following example: coloring(K, Output) :-…
Fann Wong
  • 21
  • 2
0
votes
1 answer

Call AS400 RPG from SQL Server returning parameter

In my SQL Server instance I have a linked server to AS400. I want to exec a CLP program that takes 2 parameters, a numeric(8,0) as input and an alphanumeric(3) as output. These are SQL commands that I use to do it: DECLARE @Ret varchar(3) DECLARE…
Badozvora
  • 383
  • 1
  • 3
  • 15
0
votes
1 answer

Error building 'Clp' cannot generate deps.jl in Julia?

I am trying to install and build Clp on my system in julia but am receiving an error: Error: Error building `Clp`: │ ERROR: LoadError: LibraryProduct(nothing, ["libClp"], :libClp,…
0
votes
1 answer

Why i can't build Clp

i'm facing hard times building Clp package, it takes forever. After adding the package i try to build it Pkg>Build Clpthe only thing that i'm getting is this : Building Clp → `~/.julia/packages/Clp/IBQzB/deps/build.log` without any results, i'm…
Marouane1994
  • 534
  • 3
  • 11
0
votes
1 answer

Issue getting decision variable to optimize properly in Pyomo

I have a simple multi-period optimization problem I am working on using pyomo. The goal of the model is to determine which hours a power plant should be on or off based on the Spark Spread (Power Price - Gas Price * Heat Rate + Variable Costs) for…
mgeoffb
  • 1
  • 1
0
votes
0 answers

Using CyLP repeatedly - hogging memory?

I have a program that repeatedly instantiates CyClpSimplex objects (ideally solving tens of thousands of LPs), but my kernel kills the program after ~6000 iterations. I think this is because of excessive memory usage (I'm in a docker container, and…
Battery_Al
  • 779
  • 1
  • 5
  • 20
0
votes
1 answer

Representing logical disjunctions in Constraint Handling Rules

I am writing a constraint solver in Prolog that implements a simple logical formula: "(alive(A) and animal(A)) iff (awake(A) or asleep(A))". I found one way to implement it in Constraint Handling Rules, but it is much more verbose than the original…
Anderson Green
  • 30,230
  • 67
  • 195
  • 328
0
votes
0 answers

Sending multiple Python-clp data via Modbus TCP-IP

I am developing a project using Python language to develop computer vision code and need to send data to a PLC via Modbus TCP / IP communication. I have an established communication and I can only send information about a binary record, but I would…
0
votes
1 answer

Count solutions in a CSP

I'm using prolog and I have this code: :- use_module(library(clpb)). fun(A, B, C, D, E) :- sat(A + B + C + D), sat(E), labeling([A, B, C, D, E]). If I want count all the solutions how can I do it? I've read about sat_count(+Expr, -Count)…
NxA
  • 159
  • 1
  • 12
0
votes
0 answers

Installation of Symphony on Windows 8.1 using mingw

I am trying to link coin-or symphony to Scilab. I have done it for Linux. Now I am trying to build it in Windows I have tried it with MS Visual Studio 2010 but it only generates static libraries (*.lib) files. I want to generate dll files. I tried…
Harpreet
  • 1
  • 1