Logic involving knowing when a form is ready to be submitted

  • Context: MHB 
  • Thread starter Thread starter find_the_fun
  • Start date Start date
  • Tags Tags
    Form Logic
Click For Summary
SUMMARY

The discussion revolves around creating dynamic survey logic in IBM Form Experience Builder, specifically focusing on the conditions for displaying a "Survey Complete" message. Users can only utilize logical operators AND and OR, which limits the expressiveness of the rules. The consensus is that while negation is possible, the inability to nest AND within OR or vice versa restricts the formulation of complex logical expressions. Ultimately, the participants conclude that certain Boolean functions cannot be expressed under these constraints, leading to the realization that the desired logic may be unachievable.

PREREQUISITES
  • Understanding of Boolean logic, specifically AND, OR, and NOT operations.
  • Familiarity with IBM Form Experience Builder and its rule-setting capabilities.
  • Knowledge of dynamic form behavior and conditional visibility in web forms.
  • Basic mathematical logic concepts, particularly regarding logical completeness.
NEXT STEPS
  • Research how to implement nested logical conditions in IBM Form Experience Builder.
  • Explore alternative form-building tools that support more complex logical expressions.
  • Study Boolean algebra to understand the limitations of AND and OR operations.
  • Investigate user experiences and solutions for dynamic forms in survey applications.
USEFUL FOR

This discussion is beneficial for form developers, UX designers, and anyone involved in creating dynamic surveys or forms using IBM Form Experience Builder, particularly those facing challenges with logical conditions and visibility rules.

find_the_fun
Messages
147
Reaction score
0
I am creating a form using IBM Form Experience Builder. I want to create a survey as follows (content in [] denotes possible answers)



  1. Do you still require a specified asset? [yes/no/I'm not the owner]
  2. Do you know who the owner is? [yes/no]
  3. Specify: []


Survey is complete


The questions are dynamic in the sense not all of them are shown, for example if the answer to 1. is yes 2. and 3. are hidden. The problem is creating a rule for displaying “Survey complete”. I can have an arbitrary number of rules but the relationship between them has to be all “logical or” or all “logical and”. I can specify if the message is hidden if conditions to 1., 2., 3. are met or are not met. I can't think of a way to do this but I remember learning in a math course that all logical operations can be derived from “and and not” or “or and not” which leads me to believe there is a way. Each rule can apply if a particular answer to a given question is given, or if no answer to a particular question is given (e.g. the user hasn't answered 1. yet so the rule to hide the message should apply)
 
Physics news on Phys.org
Re: logic involving knowing when a form is ready to be submited

Evgeny is your man here, but I'll just say that you have to have a method of negation, or you cannot express everything. AND and OR together are incomplete. As you mentioned, NAND and NOR are complete. It looks like you have the ability to negate, since whether your "Survey Complete" message appears can be dependent on whether a condition is or is not met.

So it seems to me that your question is this: given that from one question to the next, you have to use only AND and OR, how do you express the logic that either displays or does not display the "Survey Complete" message. Am I right?

If so, could you give us the logical expression that seems natural to you? Then maybe we can translate it into something that IBM Form Experience Builder recognizes.
 
Re: logic involving knowing when a form is ready to be submited

Ackbach said:
So it seems to me that your question is this: given that from one question to the next, you have to use only AND and OR, how do you express the logic that either displays or does not display the "Survey Complete" message. Am I right?

My interpretation of the situation is only (AND and NOT) or (OR and NOT) can be used. I say this because a rule is matched if a given condition is met or is not met, so that's negation. There can be either an AND or OR relation between all rules (e.g. a AND b AND c or a OR b OR c but not a OR b AND c). But the rest of your understanding is correct.

This is what I'd like to do but Forms Experience Builder only let's me use all [math]\vee[/math] or [math]\wedge[/math].

if
(1. matches yes $$\vee $$ 1. matches no) $$\vee $$ (1. matches I'm not owner $$\wedge$$ 2. matches no) $$\vee $$ (1. matches I'm not owner $$\wedge$$ 2. matches yes $$\wedge$$ 3. [user filled in name])
then display message
 
Re: logic involving knowing when a form is ready to be submited

It is true that OR and AND alone are incomplete, but at least in the case of yes/no questions we have negation at the atomic level. That is, the rule that checks whether an answer to some question is "no" is the negation of the rule that checks whether an answer to that question is "yes". Every Boolean function can be expressed by a formula where negations apply to variables only (not to compound formulas built from OR or AND).

find_the_fun said:
There can be either an AND or OR relation between all rules (e.g. a AND b AND c or a OR b OR c but not a OR b AND c).
This seems to be a more serious restriction. If atomic rules (the answer to some question matches, or possibly does not match, a certain answer) can be combined either only by ORs or only by ANDs, then not all Boolean functions can be expressed. Out of two-argument functions, it seems that only $p\leftrightarrow q$ and $p\oplus q$ (which are true iff the truth values of $p$ and $q$ are equal and, respectively, not equal) cannot be expressed. E.g., $p\leftrightarrow q=(p\land q)\lor(\neg p\land\neg q)$, so there are conjunctions under a disjunction. I would expect that the share of functions that cannot be expressed rises with the number of arguments.

find_the_fun said:
if
(1. matches yes $$\vee $$ 1. matches no) $$\vee $$ (1. matches I'm not owner $$\wedge$$ 2. matches no) $$\vee $$ (1. matches I'm not owner $$\wedge$$ 2. matches yes $$\wedge$$ 3. [user filled in name])
then display message
I don't see how this can be expressed without nesting AND inside OR.
 
Re: logic involving knowing when a form is ready to be submited

Evgeny.Makarov said:
It is true that OR and AND alone are incomplete, but at least in the case of yes/no questions we have negation at the atomic level. That is, the rule that checks whether an answer to some question is "no" is the negation of the rule that checks whether an answer to that question is "yes". Every Boolean function can be expressed by a formula where negations apply to variables only (not to compound formulas built from OR or AND).

This seems to be a more serious restriction. If atomic rules (the answer to some question matches, or possibly does not match, a certain answer) can be combined either only by ORs or only by ANDs, then not all Boolean functions can be expressed. Out of two-argument functions, it seems that only $p\leftrightarrow q$ and $p\oplus q$ (which are true iff the truth values of $p$ and $q$ are equal and, respectively, not equal) cannot be expressed. E.g., $p\leftrightarrow q=(p\land q)\lor(\neg p\land\neg q)$, so there are conjunctions under a disjunction. I would expect that the share of functions that cannot be expressed rises with the number of arguments.

I don't see how this can be expressed without nesting AND inside OR.

Ok thanks. It is very possible that what I'm asking for is impossible to do, I wanted to confirm it before giving up on this approach.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 40 ·
2
Replies
40
Views
8K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 57 ·
2
Replies
57
Views
6K
  • · Replies 6 ·
Replies
6
Views
2K