Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8032385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:22:06+00:00 2026-06-05T01:22:06+00:00

I have an interesting question, but I’m not sure exactly how to phrase it…

  • 0

I have an interesting question, but I’m not sure exactly how to phrase it…

Consider the lambda calculus. For a given lambda expression, there are several possible reduction orders. But some of these don’t terminate, while others do.

In the lambda calculus, it turns out that there is one particular reduction order which is guaranteed to always terminate with an irreducible solution if one actually exists. It’s called Normal Order.

I’ve written a simple logic solver. But the trouble is, the order in which it processes the constraints seems to have a huge effect on whether it finds any solutions or not. Basically, I’m wondering whether something like a normal order exists for my logic programming language. (Or wether it’s impossible for a mere machine to deterministically solve this problem.)


So that’s what I’m after. Presumably the answer critically depends on exactly what the “simple logic solver” is. So I will attempt to briefly describe it.

My program is closely based on the system of combinators in chapter 9 of The Fun of Programming (Jeremy Gibbons & Oege de Moor). The language has the following structure:

  • The input to the solver is a single predicate. Predicates may involve variables. The output from the solver is zero or more solutions. A solution is a set of variable assignments which make the predicate become true.

  • Variables hold expressions. An expression is an integer, a variable name, or a tuple of subexpressions.

  • There is an equality predicate, which compares expressions (not predicates) for equality. It is satisfied if substituting every (bound) variable with its value makes the two expressions identical. (In particular, every variable equals itself, bound or not.) This predicate is solved using unification.

  • There are also operators for AND and OR, which work in the obvious way. There is no NOT operator.

  • There is an “exists” operator, which essentially creates local variables.

  • The facility to define named predicates enables recursive looping.

One of the “interesting things” about logic programming is that once you write a named predicate, it typically works fowards and backwards (and sometimes even sideways). Canonical example: A predicate to concatinate two lists can also be used to split a list into all possible pairs.

But sometimes running a predicate backwards results in an infinite search, unless you rearrange the order of the terms. (E.g., swap the LHS and RHS of an AND or an OR somehwere.) I’m wondering whether there’s some automated way to detect the best order to run the predicates in, to ensure prompt termination in all cases where the solution set is exactually finite.

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:22:09+00:00Added an answer on June 5, 2026 at 1:22 am

    Relevant paper, I think: http://www.cs.technion.ac.il/~shaulm/papers/abstracts/Ledeniov-1998-DCS.html

    Also take a look at this: http://en.wikipedia.org/wiki/Constraint_logic_programming#Bottom-up_evaluation

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have an interesting question that I am not sure is considered a
I have interesting question. According to MSDN yield syntax : yield return <expression>; //
I have recently come across an interesting question on strings. Suppose you are given
I have a broad but interesting OpenCV question and I'm wondering where to start.
I have an interesting question on initialization. I have the following code: public class
I have a interesting question: I want to split the year into 4 quarters.
I have an interesting question about interface builder and ARC. I am building a
An interesting question arose today. Let's say I have a .NET object that implements
Here's an interesting question about the various quirks of the C++ language. I have
So I have an interesting design question regarding an app I'm developing for the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.