Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use built-in implicitly defined functions (e.g., sin(x)) #113

Open
wdsmth opened this issue Jan 29, 2024 · 1 comment
Open

Unable to use built-in implicitly defined functions (e.g., sin(x)) #113

wdsmth opened this issue Jan 29, 2024 · 1 comment

Comments

@wdsmth
Copy link

wdsmth commented Jan 29, 2024

I'm using KeYmaera X 5.0.2 on a remote Linux server (Ubuntu 22.04.3 LTS, amd64 architecture) accessed from a local Mac M1. The IJCAR22 implicit function examples do not appear, only the Textbook and Beginner's Tutorial Examples. (https://keymaerax.org/keymaeraXfunc/ indicates "To begin, click on the Import button for IJCAR22 Implicit Definitions Examples to load pre-defined example models.")

I copied the Arctan Identity example from implicitdefinitions.kyx. Apparently built-in functions like sin, cos, are known to my instance of KeYmaera X:

Screen Shot 2024-01-29 at 2 26 43 PM

There are no errors or other warnings, but upon clicking "New proof", an error about undefined symbols cos,sin appears:

Screen Shot 2024-01-29 at 2 28 02 PM

(NB: Implicit definitions work; e.g., I can define my own versions of sin,cos: implicit Real sine(Real t), cosine(Real t) = {{sine:=0; cosine:=1; t:=0;}; {sine'=cosine, cosine'=-sine, t'=1}};. However, this isn't very robust due to limitations on using custom functions. For example, t=0 & sine(0)=0 & cosine(0)=1 & x=1-> [{x'=-(sine(t)),t'=1} triggers a Core error:

Screen Shot 2024-01-29 at 3 26 59 PM

In contrast, t=0 & x=0 & xdot=1 -> [{x'=xdot, xdot'=-x, t'=1}]x<=1 proves automatically. In my limited experience with implicit definitions, automation seems to perform worse in general, even when no errors are thrown. For instance t=0 & sine(0)=0 & cosine(0)=1 -> [{t'=1}@invariant((sine(t))^2 + (cosine(t))^2=1)]sine(t)<=1 requires the invariant for Auto to succeed.)

Probably extraneous detail: While running, the GUI shows "KeYmaera X 5.0.2 (no network)." at the bottom left.

@EnguerrandPrebet
Copy link
Contributor

If you only see the Textbook and the Beginner's Examples, it is likely that you have selected "Learner's Mode" when starting KeYmeara X for the first time. The other examples appear if you choose "Industry Mode".
To reset it, you can delete the keymaerax.sqlite file in ~/.keymaerax.
Be careful that it will delete the visible models you currently have, so do not forget to click "Export all" beforehand.

The file you mentioned (implicitdefinitions.kyx) imports sin and cos explicitly: import kyx.math.{cos,sin};. The parser was misleading in that regard, it has been fixed in the current release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants