XPSconditionfindneval

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Artificial Intelligence
Introduced first in SolidGeometry 5.4, Creation date: 2023-11-30, Last change: 2025-09-15

creates all combinations of a variable based CONDITION that could fit a fact list CONDITION

Description

1st name was "stringpatterncondition"
This function checks whether a list of conditions (COND is a fact string array with variables $) can occur or is applicable in a given state (STATE is a fact string array without variables). If the list COND is applicable in STATE with several different variable assignments, all applicable combinations of the variables are delivered and further variable-based lists can be instantiated with the instantiated variables.

XPpermute(' ',["a" "b"],["C" "D"])
Equations, or systems of equations, that are based on the form "$A on $B" must be limited in their scope of application in some way so that the recursion or planning comes to an end. For example, NOT (table on ANY)For example, by specifying the set of allowed or disallowed symbols

This functions as part of the general Problem solver can also be used as logical reasoning
cond = condition
state = state
VLIST = everything that also is valid under this condition

See Also: stringpatterncompare , XPSEQS

Example Illustration

 missing image of XPSconditionfindneval(cond,state,VLIST)

Syntax

[RLIST,VLIST,VARS,INST,SYMS]=XPSconditionfindneval(cond,state,[VLIST])

Input Parameter

cond: string array of conditions with Variables of Type $Str
state: string array of facts
VLIST: Additional string arrys with variables

Output Parameter

RLIST: all possible condition strings that are part of state
VLIST: all possible additional condition strings that use the same combination of VARS/INST
VARS: all used symbol names in cond
INST: all symbol combinations used as variables that fullfill the condition in state
SYMS: string array of all samples

Examples


[~,start,goal]=XPSblocksworld;
clc;XPSconditionfindneval(["space on $A", "space on $C", "$A on $B"],start)
clc;XPSconditionfindneval([ "space on $A", "space on $C", "$A on $B"],start,["move $A from $B to $C"], ["$A on $C", "space on $B"], ["$A on $B", "space on $C"])
clc;XPSconditionfindneval(["$A on $B"],["space on a", "a on b", "b on c", "c on table", "space on table"]) % 5 Solutions for "$A on $B"
clc;XPSconditionfindneval(["space on $A" "$A on $B"],["space on a", "a on b", "b on c", "c on table", "space on table"]) % 1 Solutions for "$A on $B"
clc;XPSconditionfindneval(["space on $A" "$B on $A"],["space on a", "a on b", "b on c", "c on table", "space on table"]) % 1 Solutions for "$B on $A"
clc;XPSconditionfindneval(["$A on $B"],["space on a", "a on b", "b on c", "c on table", "space on table"],["$A loves $B"]) % 5 Solutions that create lists

References

- Norvig, Peter (1991): Paradigms of Artificial Intelligence Programming, Morgan Kaufmann Publisher, San Mateo, CA, USA



Copyright 2023-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Last html export of this page out of FM database by TL: 2025-09-21